doco
This commit is contained in:
1 parent
7bccefd01b
commit
c736f2ed2d
4 files changed
+62
-50
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
Revision history for Mojolicious::Plugin::TtRenderer
|
Revision history for Mojolicious::Plugin::TtRenderer
|
||||||
|
|
||||||
{{$NEXT}}
|
{{$NEXT}}
|
||||||
|
- Documentation updates.
|
||||||
|
|
||||||
1.38 January 27, 2013
|
1.38 January 27, 2013
|
||||||
- fixed but where DATA templates were not being rendered with empty renderer path
|
- fixed but where DATA templates were not being rendered with empty renderer path
|
||||||
|
|||||||
+13
-10
@@ -6,13 +6,13 @@ Mojolicious::Plugin::TtRenderer - Template Renderer Plugin
|
|||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
# Mojolicious
|
# Mojolicious
|
||||||
$self->plugin('tt_renderer');
|
$self->plugin('tt_renderer');
|
||||||
$self->plugin(tt_renderer => {template_options => {FILTERS => [ ... ]}});
|
$self->plugin(tt_renderer => {template_options => {FILTERS => [ ... ]}});
|
||||||
|
|
||||||
# Mojolicious::Lite
|
# Mojolicious::Lite
|
||||||
plugin 'tt_renderer';
|
plugin 'tt_renderer';
|
||||||
plugin tt_renderer => {template_options => {FILTERS => [ ... ]}};
|
plugin tt_renderer => {template_options => {FILTERS => [ ... ]}};
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ L<Mojolicious::Plugin> and implements the following new ones.
|
|||||||
|
|
||||||
=head2 C<register>
|
=head2 C<register>
|
||||||
|
|
||||||
$plugin->register;
|
$plugin->register;
|
||||||
|
|
||||||
Register renderer in L<Mojolicious> application.
|
Register renderer in L<Mojolicious> application.
|
||||||
|
|
||||||
@@ -34,11 +34,14 @@ Register renderer in L<Mojolicious> application.
|
|||||||
|
|
||||||
The current controller instance can be accessed as C<c>.
|
The current controller instance can be accessed as C<c>.
|
||||||
|
|
||||||
[% c.req.headers.host %]
|
[% c.req.headers.host %]
|
||||||
|
|
||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
L<Mojolicious::Plugin::TtRenderer::Engine>, L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicious.org>.
|
L<Mojolicious::Plugin::TtRenderer::Engine>,
|
||||||
|
L<Mojolicious>,
|
||||||
|
L<Mojolicious::Guides>,
|
||||||
|
L<http://mojolicious.org>.
|
||||||
|
|
||||||
=head1 AUTHOR
|
=head1 AUTHOR
|
||||||
|
|
||||||
@@ -55,7 +58,7 @@ L<https://github.com/abh/mojox-renderer-tt/issues?state=open>.
|
|||||||
|
|
||||||
You can find documentation for this module with the perldoc command.
|
You can find documentation for this module with the perldoc command.
|
||||||
|
|
||||||
perldoc Mojolicious::Plugin::TtRenderer
|
perldoc Mojolicious::Plugin::TtRenderer
|
||||||
|
|
||||||
You can also look for information at:
|
You can also look for information at:
|
||||||
|
|
||||||
|
|||||||
@@ -32,13 +32,13 @@ Mojolicious::Plugin::TtRenderer - Template Renderer Plugin
|
|||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
# Mojolicious
|
# Mojolicious
|
||||||
$self->plugin('tt_renderer');
|
$self->plugin('tt_renderer');
|
||||||
$self->plugin(tt_renderer => {template_options => {FILTERS => [ ... ]}});
|
$self->plugin(tt_renderer => {template_options => {FILTERS => [ ... ]}});
|
||||||
|
|
||||||
# Mojolicious::Lite
|
# Mojolicious::Lite
|
||||||
plugin 'tt_renderer';
|
plugin 'tt_renderer';
|
||||||
plugin tt_renderer => {template_options => {FILTERS => [ ... ]}};
|
plugin tt_renderer => {template_options => {FILTERS => [ ... ]}};
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ L<Mojolicious::Plugin> and implements the following new ones.
|
|||||||
|
|
||||||
=head2 C<register>
|
=head2 C<register>
|
||||||
|
|
||||||
$plugin->register;
|
$plugin->register;
|
||||||
|
|
||||||
Register renderer in L<Mojolicious> application.
|
Register renderer in L<Mojolicious> application.
|
||||||
|
|
||||||
@@ -60,11 +60,14 @@ Register renderer in L<Mojolicious> application.
|
|||||||
|
|
||||||
The current controller instance can be accessed as C<c>.
|
The current controller instance can be accessed as C<c>.
|
||||||
|
|
||||||
[% c.req.headers.host %]
|
[% c.req.headers.host %]
|
||||||
|
|
||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
L<Mojolicious::Plugin::TtRenderer::Engine>, L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicious.org>.
|
L<Mojolicious::Plugin::TtRenderer::Engine>,
|
||||||
|
L<Mojolicious>,
|
||||||
|
L<Mojolicious::Guides>,
|
||||||
|
L<http://mojolicious.org>.
|
||||||
|
|
||||||
=head1 AUTHOR
|
=head1 AUTHOR
|
||||||
|
|
||||||
@@ -81,7 +84,7 @@ L<https://github.com/abh/mojox-renderer-tt/issues?state=open>.
|
|||||||
|
|
||||||
You can find documentation for this module with the perldoc command.
|
You can find documentation for this module with the perldoc command.
|
||||||
|
|
||||||
perldoc Mojolicious::Plugin::TtRenderer
|
perldoc Mojolicious::Plugin::TtRenderer
|
||||||
|
|
||||||
You can also look for information at:
|
You can also look for information at:
|
||||||
|
|
||||||
|
|||||||
@@ -227,27 +227,27 @@ Mojolicious::Plugin::TtRenderer::Engine - Template Toolkit renderer for Mojo
|
|||||||
|
|
||||||
Add the handler:
|
Add the handler:
|
||||||
|
|
||||||
sub startup {
|
sub startup {
|
||||||
...
|
...
|
||||||
|
|
||||||
# Via mojolicious plugin
|
# Via mojolicious plugin
|
||||||
$self->plugin(tt_renderer => {template_options => {FILTERS => [ ... ]}});
|
$self->plugin(tt_renderer => {template_options => {FILTERS => [ ... ]}});
|
||||||
|
|
||||||
# Or manually
|
# Or manually
|
||||||
use Mojolicious::Plugin::TtRenderer::Engine;
|
use Mojolicious::Plugin::TtRenderer::Engine;
|
||||||
|
|
||||||
my $tt = Mojolicious::Plugin::TtRenderer::Engine->build(
|
my $tt = Mojolicious::Plugin::TtRenderer::Engine->build(
|
||||||
mojo => $self,
|
mojo => $self,
|
||||||
template_options => {
|
template_options => {
|
||||||
PROCESS => 'tpl/wrapper',
|
PROCESS => 'tpl/wrapper',
|
||||||
FILTERS => [ ... ],
|
FILTERS => [ ... ],
|
||||||
UNICODE => 1,
|
UNICODE => 1,
|
||||||
ENCODING => 'UTF-8',
|
ENCODING => 'UTF-8',
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$self->renderer->add_handler( tt => $tt );
|
$self->renderer->add_handler( tt => $tt );
|
||||||
}
|
}
|
||||||
|
|
||||||
Template parameter are taken from C< $c->stash >.
|
Template parameter are taken from C< $c->stash >.
|
||||||
|
|
||||||
@@ -257,20 +257,20 @@ The template file for C<"example/welcome"> would be C<"templates/welcome.html.tt
|
|||||||
|
|
||||||
When template file is not available rendering from C<__DATA__> is attempted.
|
When template file is not available rendering from C<__DATA__> is attempted.
|
||||||
|
|
||||||
__DATA__
|
__DATA__
|
||||||
|
|
||||||
@@ welcome.html.tt
|
@@ welcome.html.tt
|
||||||
Welcome, [% user.name %]!
|
Welcome, [% user.name %]!
|
||||||
|
|
||||||
Inline template is also supported:
|
Inline template is also supported:
|
||||||
|
|
||||||
$self->render(inline => '[% 1 + 1 %]', handler => 'tt');
|
$self->render(inline => '[% 1 + 1 %]', handler => 'tt');
|
||||||
|
|
||||||
=head1 HELPERS
|
=head1 HELPERS
|
||||||
|
|
||||||
Helpers are exported automatically under C<h> namespace.
|
Helpers are exported automatically under C<h> namespace.
|
||||||
|
|
||||||
[% h.url_for('index') %]
|
[% h.url_for('index') %]
|
||||||
|
|
||||||
=head1 METHODS
|
=head1 METHODS
|
||||||
|
|
||||||
@@ -288,7 +288,11 @@ object. When used the INCLUDE_PATH will be set to
|
|||||||
|
|
||||||
=item template_options
|
=item template_options
|
||||||
|
|
||||||
A hash reference of options that are passed to Template->new().
|
A hash reference of options that are passed to Template->new(). Note that if you
|
||||||
|
specify an C<INCLUDE_PATH> through this option it will remove the DATA section
|
||||||
|
templates from your path. A better way to specify an C<INCLUDE_PATH> if you also
|
||||||
|
want to use DATA section templates it by manipulting the L<Mojolicious::Renderer>
|
||||||
|
path.
|
||||||
|
|
||||||
=item cache_dir
|
=item cache_dir
|
||||||
|
|
||||||
@@ -297,18 +301,19 @@ templates. Will default to a temp-dir if not set.
|
|||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
=head1 SEE ALSO
|
||||||
|
|
||||||
|
L<Mojolicious::Plugin::TtRenderer::Engine>,
|
||||||
|
L<Mojolicious>,
|
||||||
|
L<Mojolicious::Guides>,
|
||||||
|
L<http://mojolicious.org>.
|
||||||
|
|
||||||
=head1 AUTHOR
|
=head1 AUTHOR
|
||||||
|
|
||||||
Current maintainer: Graham Ollis C<< <plicease@cpan.org> >>
|
Current maintainer: Graham Ollis C<< <plicease@cpan.org> >>
|
||||||
|
|
||||||
Original author: Ask Bjørn Hansen, C<< <ask at develooper.com> >>
|
Original author: Ask Bjørn Hansen, C<< <ask at develooper.com> >>
|
||||||
|
|
||||||
=head1 TODO
|
|
||||||
|
|
||||||
* Better support non-Mojolicious frameworks
|
|
||||||
* Better way to pass parameters to the templates? (stash)
|
|
||||||
* More sophisticated default search path?
|
|
||||||
|
|
||||||
=head1 BUGS
|
=head1 BUGS
|
||||||
|
|
||||||
Please report any bugs or feature requests to the project's github issue tracker
|
Please report any bugs or feature requests to the project's github issue tracker
|
||||||
@@ -318,7 +323,7 @@ L<https://github.com/abh/mojox-renderer-tt/issues?state=open>.
|
|||||||
|
|
||||||
You can find documentation for this module with the perldoc command.
|
You can find documentation for this module with the perldoc command.
|
||||||
|
|
||||||
perldoc Mojolicious::Plugin::TtRenderer::Engine
|
perldoc Mojolicious::Plugin::TtRenderer::Engine
|
||||||
|
|
||||||
You can also look for information at:
|
You can also look for information at:
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user