Skip to content

Commit

Permalink
better descriptions for renderer methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 21, 2015
1 parent c7a22d7 commit e6f5d1e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
6 changes: 4 additions & 2 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -1409,8 +1409,10 @@ called.

1;

Since most template systems don't support templates in the C<DATA> section, the
renderer provides methods to help you with that.
An C<inline> template, if provided by the user, will be passed along with the
options. The C<templates> directories of the application can be searched with
L<Mojolicious::Renderer/"template_path">, and the C<DATA> sections with
L<Mojolicious::Renderer/"get_data_template">.

use Mojolicious::Lite;

Expand Down
23 changes: 13 additions & 10 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -386,9 +386,9 @@ Register a helper.
handler => 'epl'
});
Get a C<DATA> section template from L</"classes"> for an options hash reference
with C<template>, C<format>, C<variant> and C<handler> values, usually used by
handlers.
Return a C<DATA> section template from L</"classes"> for an options hash
reference with C<template>, C<format>, C<variant> and C<handler> values, or
C<undef> if no template could be found, usually used by handlers.
=head2 get_helper
Expand All @@ -413,7 +413,8 @@ L<Mojolicious::Controller/"render"> for a more user-friendly interface.
my $name = $renderer->template_for(Mojolicious::Controller->new);
Generate default template name for L<Mojolicious::Controller> object.
Return default template name for L<Mojolicious::Controller> object, or C<undef>
if no name could be generated.
=head2 template_handler
Expand All @@ -422,8 +423,8 @@ Generate default template name for L<Mojolicious::Controller> object.
format => 'html'
});
Detect handler for an options hash reference with C<template>, C<format> and
C<variant> values.
Return handler for an options hash reference with C<template>, C<format> and
C<variant> values, or C<undef> if no handler could be found.
=head2 template_name
Expand All @@ -433,8 +434,9 @@ C<variant> values.
handler => 'epl'
});
Build a template name for an options hash reference with C<template>, C<format>,
C<variant> and C<handler> values, usually used by handlers.
Return a template name for an options hash reference with C<template>,
C<format>, C<variant> and C<handler> values, or C<undef> if no template could be
found, usually used by handlers.
=head2 template_path
Expand All @@ -444,8 +446,9 @@ C<variant> and C<handler> values, usually used by handlers.
handler => 'epl'
});
Build a full template path for an options hash reference with C<template>,
C<format>, C<variant> and C<handler> values, usually used by handlers.
Return the full template path for an options hash reference with C<template>,
C<format>, C<variant> and C<handler> values, or C<undef> if the file does not
exist in L</"paths">, usually used by handlers.
=head2 warmup
Expand Down

0 comments on commit e6f5d1e

Please sign in to comment.