Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better helper documentation

  • Loading branch information...
commit 0508176ab048fb41fb21ed9fdf9fa2f68c0646e8 1 parent 122b2d3
@kraih authored
Showing with 14 additions and 6 deletions.
  1. +1 −0  Changes
  2. +13 −6 lib/Mojolicious/Plugin/DefaultHelpers.pm
View
1  Changes
@@ -5,6 +5,7 @@ This file documents the revision history for Perl extension Mojolicious.
Mojolicious::Plugin::DefaultHelpers.
- Made text_area helper a little smarter. (sshaw, sri)
- Improved inactivity timeout logging for WebSockets.
+ - Improved documentation.
- Fixed escaping bug in select_field and text_area helpers.
- Fixed Windows bug in "asset.t".
View
19 lib/Mojolicious/Plugin/DefaultHelpers.pm
@@ -160,9 +160,13 @@ Alias for L<Mojo/"config">.
=head2 C<content>
+ %= content foo => begin
+ test
+ % end
+ %= content 'foo'
%= content
-Insert content into a layout template.
+Store content and retrieve it.
=head2 C<content_for>
@@ -193,15 +197,16 @@ EXPERIMENTAL and might change without warning!
=head2 C<dumper>
- %= dumper $foo
+ %= dumper {some => 'data'}
Dump a Perl data structure using L<Data::Dumper>.
=head2 C<extends>
- % extends 'foo';
+ % extends 'blue';
+ % extends 'blue', title => 'Blue!';
-Extend a template.
+Extend a template, all arguments get merged into the stash.
=head2 C<flash>
@@ -220,8 +225,9 @@ only available in the partial template.
=head2 C<layout>
% layout 'green';
+ % layout 'green', title => 'Green!';
-Render this template with a layout.
+Render this template with a layout, all arguments get merged into the stash.
=head2 C<memorize>
@@ -262,9 +268,10 @@ Alias for L<Mojolicious::Controller/"stash">.
=head2 C<title>
% title 'Welcome!';
+ % title 'Welcome!', foo => 'bar';
%= title
-Page title.
+Page title, all arguments get merged into the stash.
=head2 C<url_for>
Please sign in to comment.
Something went wrong with that request. Please try again.