NAME

Convos::Plugin::Helpers - Mojo's little helpers

HELPERS

id_as

See "id_as" in Convos::Core::Util.

as_id

See "as_id" in Convos::Core::Util.

form_block

%= form_block $name, class => [$str, ...] begin
...
% end

The code above will create this markup:

<div class="@$class" title="$error">
  ...
</div>

In addition, <@$class> will contain "error" if $error can be fetched from the stash hash errors, using $name as key.

format_conversation

$c->format_conversation(\&iterator, \&callback);

Takes a list of JSON strings and turns them into a list of hash-refs where the "message" key contains a formatted version with HTML and such. The result will be passed on to the $callback.

logf

See "logf" in Convos::Core::Util.

redis

Returns a Mojo::Redis object.

send_partial

Will render "partial" and send the result.

timestamp_span

Returns a "<span>" tag with a timestamp.

redirect_last $login

Redirect to the last visited channel for $login. Falls back to settings.

METHODS

register

Will register the "HELPERS" above.

AUTHOR

Jan Henning Thorsen - jhthorsen@cpan.org