| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 
 | NAME
    Mojolicious::Plugin::TemplateToolkit - Template Toolkit renderer plugin
    for Mojolicious
SYNOPSIS
     # Mojolicious
     $app->plugin('TemplateToolkit');
     $app->plugin(TemplateToolkit => {name => 'foo'});
     $app->plugin(TemplateToolkit => {template => {INTERPOLATE => 1}});
     
     # Mojolicious::Lite
     plugin 'TemplateToolkit';
     plugin TemplateToolkit => {name => 'foo'};
     plugin TemplateToolkit => {template => {INTERPOLATE => 1}});
     
     # Set as default handler
     $app->renderer->default_handler('tt2');
     
     # Render without setting as default handler
     $c->render(template => 'bar', handler => 'tt2');
DESCRIPTION
    Mojolicious::Plugin::TemplateToolkit is a renderer for tt2 or Template
    Toolkit templates. See Template and Template::Manual for details on the
    Template Toolkit format, and Mojolicious::Guides::Rendering for general
    information on rendering in Mojolicious.
    Along with template files, inline and data section templates can be
    rendered in the standard Mojolicious fashion. Template files and data
    sections will be retrieved using Mojolicious::Renderer via
    Template::Provider::Mojo for both direct rendering and directives such
    as INCLUDE. This means that instead of specifying INCLUDE_PATH, you
    should set "paths" in Mojolicious::Renderer to the appropriate paths.
     $app->renderer->paths(['/path/to/templates']);
     push @{$app->renderer->paths}, '/path/to/more/templates';
    Mojolicious stash values will be exposed directly as variables in the
    templates, and the current controller object will be available as c or
    self, similar to Mojolicious::Plugin::EPRenderer.
    Helper methods can be called on the controller object as normal, as
    well as on a proxy object available as h. The proxy object was
    previously needed for efficiency as the controller object used AUTOLOAD
    to call helper methods, but since Mojolicious 8.04 the controller
    object uses a more efficient mechanism and the proxy object is no
    longer needed. See Mojolicious::Plugin::DefaultHelpers and
    Mojolicious::Plugin::TagHelpers for a list of all built-in helper
    methods.
    Accessing helper methods directly as variables, rather than via the
    controller or proxy object, is deprecated and may be removed in a
    future release.
     $c->stash(description => 'template engine');
     $c->stash(engines => [qw(Template::Toolkit Text::Template)]);
     
     [% FOREACH engine IN engines %]
       [% engine %] is a [% description %].
     [% END %]
     
     [% c.link_to('Template Toolkit', 'http://www.template-toolkit.org') %]
     
     [% c.param('foo') %]
OPTIONS
    Mojolicious::Plugin::TemplateToolkit supports the following options.
 name
     # Mojolicious::Lite
     plugin TemplateToolkit => {name => 'foo'};
    Handler name, defaults to tt2.
 template
     # Mojolicious::Lite
     plugin TemplateToolkit => {template => {INTERPOLATE => 1}};
    Configuration values passed to Template object used to render
    templates. Note that Template::Provider::Mojo will use "paths" in
    Mojolicious::Renderer to find templates, not INCLUDE_PATH specified
    here.
METHODS
    Mojolicious::Plugin::TemplateToolkit inherits all methods from
    Mojolicious::Plugin and implements the following new ones.
 register
     $plugin->register(Mojolicious->new);
     $plugin->register(Mojolicious->new, {name => 'foo'});
    Register renderer in Mojolicious application.
BUGS
    Report any issues on the public bugtracker.
AUTHOR
    Dan Book <dbook@cpan.org>
COPYRIGHT AND LICENSE
    This software is Copyright (c) 2015 by Dan Book.
    This is free software, licensed under:
      The Artistic License 2.0 (GPL Compatible)
SEE ALSO
    Mojolicious::Renderer, Template, Template::Provider::Mojo
 |