Mojolicious::Plugin::AlloyRenderer - Template::Alloy renderer plugin
version 1.121150
Mojolicious
$self->plugin( 'alloy_renderer' ); $self->plugin( 'alloy_renderer', { syntax => 'TT', template_options => { TRIM => 1, PRE_CHOMP => 1, POST_CHOMP => 1, } } );
Mojolicious::Lite
plugin( 'alloy_renderer' ); plugin( 'alloy_renderer', { syntax => 'TT', template_options => { TRIM => 1, PRE_CHOMP => 1, POST_CHOMP => 1, } } );
Mojolicious::Plugin::AlloyRenderer is a loader for MojoX::Renderer::Alloy.
$plugin->register( %config );
Registers this plugin within Mojolicious application.
Following options are supported:
Default syntax is TT.
TT
$plugin->register( syntax => 'TT', );
Possible scalar values are:
# syntax # default extension (handler) # syntax TT tt Template::Alloy::TT Velocity vtl Template::Alloy::Velocity Tmpl tmpl Template::Alloy::Tmpl HTE hte Template::Alloy::HTE
You may also choose your own templates extensions (handler):
$plugin->register( syntax => { 'TT' => 'tt3' }, );
or enable multiple templating engines at once:
# with default extensions $plugin->register( syntax => [qw( TT Tmpl )], ); # or all $plugin->register( syntax => ':all', ); # with custom extensions $plugin->register( syntax => { 'TT' => 'tt3', 'HTE' => 'ht', }, );
Chosen syntax will be set as default handler by calling "default_handler" in Mojolicious::Renderer.
Please note that if you pass multiple options the last one will be set as default (random in case of hashref).
$plugin->register( template_options => { INCLUDE_PATH => $app->home->rel_dir('templates'), COMPILE_EXT => '.ct', COMPILE_DIR => ( $app->home->rel_dir('tmp/ctpl') || File::Spec->tmpdir ), UNICODE => 1, ENCODING => 'utf-8', CACHE_SIZE => 128, RELATIVE => 1, ABSOLUTE => 1, } );
Configuration options as described in "CONFIGURATION" in Template::Alloy.
Above are the default options for all engines.
Please see those modules/websites for more information related to this module.
MojoX::Renderer::Alloy
Alex J. G. Burzyński <ajgb@cpan.org>
This software is copyright (c) 2012 by Alex J. G. Burzyński <ajgb@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install MojoX::Renderer::Alloy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MojoX::Renderer::Alloy
CPAN shell
perl -MCPAN -e shell install MojoX::Renderer::Alloy
For more information on module installation, please visit the detailed CPAN module installation guide.