Take me over?
NAME
Posy::Plugin::TextTemplate - Posy plugin for interpolating with Text::Template
VERSION
This describes version 0.05 of Posy::Plugin::TextTemplate.
SYNOPSIS
@plugins = qw(Posy::Core Posy::Plugin::TextTemplate);
DESCRIPTION
This overrides Posy's simple interpolate() method, by using the Text::Template module. This is not compatible with core Posy style interpolation.
Note that, if you want access to any of posy's methods inside a template, the Posy object should be available through the variable "$Posy".
Configuration
This expects configuration settings in the $self->{config} hash, which, in the default Posy setup, can be defined in the main "config" file in the data directory.
- tt_recurse_into_entry
-
Do you want me to recursively interpolate into the entry $title and $body? Consider carefully before turning this on, since if anyone other than you has the ability to post stories, there is a chance of foolishness or malice, exposing variables and calling actions/subroutines you might not want called. (0 = No, 1 = Yes)
- tt_left_delim tt_right_delim
-
The delimiters to use for Text::Template; for the sake of speed, it is best not to use the original '{' '}' delimiters. (default: tt_left_delim='[==', tt_right_delim='==]')
OBJECT METHODS
Documentation for developers and those wishing to write plugins.
init
Do some initialization; make sure that default config values are set.
Helper Methods
Methods which can be called from within other methods.
set_vars
my %vars = $self->set_vars(\%flow_state);
my %vars = $self->set_vars(\%flow_state, \%current_entry, \%entry_state);
Sets variable hashes to be used in interpolation of templates.
This can be called from a flow action or as an entry action, and will use the given state hashes accordingly.
interpolate
$content = $self->interpolate($chunk, $template, \%vars);
Interpolate the contents of the vars hash with the template and return the result. (This is passed the chunk name just in case one wishes to do something different depending on what chunk type it is.)
REQUIRES
Text::Template
Test::More
SEE ALSO
perl(1). Posy
BUGS
Please report any bugs or feature requests to the author.
AUTHOR
Kathryn Andersen (RUBYKAT)
perlkat AT katspace dot com
http://www.katspace.com
COPYRIGHT AND LICENCE
Copyright (c) 2004 by Kathryn Andersen
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.