NAME

Action::Generic::Plugin::Template - Render a Template::Toolkit

SYNOPSIS

my $temp = $controller->action(
 type => 'Template',
 name => 'A TT-generated something!',
 template => 'a_template.tt',
 stash => $stash,
 config => { INCLUDE_PATAH => '/foo/bar' } 
);

DESCRIPTION

This action will use Template::Toolkit to render a template. The results of the render are returned by run() as well as placed in the "results" data structure under the key rendered.

Default Configuration

Some basic configuration is already done in the action for Template. They may be overriddenby with the 'config' parameter. Bear in mind, supplying your own config overwrites all defaults. Don't leave anything out!

template

Default is template.tt. This is the first parameter passed to Template's process() (see their documentation for what this may be).

stash

Default is an empty hashref -- C><{}>. This is the second parameter passed to Template's process().

config
INCLUDE_PATH

Default is '.'

INTERPOLATE

Default is 1

POST_CHOMP

Default is 1

EVAL_PERL

Default is 1

Results

The rendered template is stored in the output key of the results.

This should almost always be a scalar. Unless you're doing something funky.

SEE ALSO

Action::Generic, Template

LICENSE

Copyright (c) 2010 Dave Houston. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.