NAME

Pinwheel::View::ERB - Simple templating based on Ruby's erb syntax

SYNOPSIS

my $src = 'Hello <%= "world" %>';

$template = Pinwheel::View::ERB::parse_template($src);
$template = Pinwheel::View::ERB::parse_template($src, $name);

$result = &$template($locals, $globals, $fns);

DESCRIPTION

Pinwheel::View::ERB implements a simple subset of Ruby's erb templating syntax (as used in .rhtml templates in Ruby on Rails).

ROUTINES

parse_template(CONTENT) or parse_template(CONTENT, NAME)

Parse the string in CONTENT as a template, optionally associating NAME with the result for use in error messages. The return value is a function reference that can be called to generate the output.

&$template(LOCALS, GLOBALS, FNS)

Render the template (the result of parse_template) and return the result as a string. The LOCALS and GLOBALS hashes contain the local and global namespaces, and may be updated by the template. The FNS hash specifies which functions should be exposed to the template.

AUTHOR

A&M Network Publishing <DLAMNetPub@bbc.co.uk>