Skip to content

Commit

Permalink
more helper documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 15, 2014
1 parent 27f4527 commit b8b1a85
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -462,10 +462,16 @@ passed to the renderer.

=head2 Helpers

Helpers are little functions you can use in templates and controller code.
Helpers are little functions you can use in templates as well as application
and controller code.

# Template
%= dumper [1, 2, 3]

# Application
my $serialized = $app->dumper([1, 2, 3]);

# Controller
my $serialized = $c->dumper([1, 2, 3]);

The helper L<Mojolicious::Plugin::DefaultHelpers/"dumper"> for example will
Expand All @@ -479,8 +485,8 @@ specific and mostly used to generate HTML tags.
% end

In controllers you can also use the method
L<Mojolicious::Controller/"helpers"> to ensure that helper calls don't
conflict with existing methods you may already have.
L<Mojolicious::Controller/"helpers"> to fully qualify helper calls and ensure
that they don't conflict with existing methods you may already have.

my $serialized = $c->helpers->dumper([1, 2, 3]);

Expand Down

0 comments on commit b8b1a85

Please sign in to comment.