|
NAMEMojolicious::Plugin::TtRenderer - Template Renderer Plugin for MojoliciousVERSIONversion 1.62SYNOPSISMojolicious::Lite:plugin 'tt_renderer'; Mojolicious: $self->plugin('tt_renderer'); DESCRIPTIONThis plugin is a simple Template Toolkit renderer for Mojolicious. Its defaults are usually reasonable, although for finer grain detail in configuration you may want to use Mojolicious::Plugin::TtRenderer::Engine directly.OPTIONSThese are the options that can be passed in as arguments to this plugin.template_optionsConfiguration hash passed into Template's constructor, see Template Toolkit's configuration summary for details. Here is an example using the Mojolicious::Lite form:plugin 'tt_renderer' => { template_options => { PRE_CHOMP => 1, POST_CHOMP => 1, TRIM => 1, }, }; Here is the same example using the full Mojolicious app form: package MyApp; use Mojo::Base qw( Mojolicious ); sub startup { my($self) = @_; $self->plugin('tt_renderer' => { template_options => { PRE_CHOMP => 1, POST_CHOMP => 1, TRIM => 1, }, } ... } These options will be used if you do not override them:
cache_dirSpecifies the directory in which compiled template files are written. This:plugin 'tt_renderer', { cache_dir => 'some/path' }; is equivalent to plugin 'tt_renderer', { template_options { COMPILE_DIR => 'some/path' } }; except in the first example relative paths are relative to the Mojolicious app's home directory ("$app->home"). STASHhHelpers are available via the "h" entry in the stash.<a href="[% h.url_for('index') %]">go back to index</a> cThe current controller instance can be accessed as "c".I see you are requesting a document from [% c.req.headers.host %]. EXAMPLES
These are also included with the "Mojolicious::Plugin::TtRenderer" distribution, including the support files required for the full Mojolicious app example. SEE ALSOMojolicious::Plugin::TtRenderer::Engine, Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.AUTHOROriginal author: Ask Bjørn HansenCurrent maintainer: Graham Ollis <plicease@cpan.org> Contributors: vti Marcus Ramberg Matthias Bethke Htbaa Magnus Holm Maxim Vuets Rafael Kitover giftnuss Cosimo Streppone Fayland Lam Jason Crowther spleenjack Árpád Szász Сергей Романов uwisser Dinis Lage jay mortensen (GMORTEN) Matthew Lawrence (MATTLAW) COPYRIGHT AND LICENSEThis software is copyright (c) 2009-2021 by Ask Bjørn Hansen.This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Visit the GSP FreeBSD Man Page Interface. |