NAME

Template::TAL::Language::TALES - methods to parse TALES strings

SYNOPSIS

my $value = Template::TAL::Language::TALES->process_tales_path(
  "/foo/bar",
  { foo => { bar => "2" } },
);

DESCRIPTION

TALES is the recommended syntax for TAL expressions. It is an extensible syntax that allows you to define any number of expression types and use them together. See http://www.zope.org/Wikis/DevSite/Projects/ZPT/TALES for the spec.

This module provides the parser hooks for a TALES implementation, and it is called by Template::TAL::ValueParser.

process_tales_path( path, contexts, plugins )

follows the path into the passed contexts. Will return the value of the key if it is found in any of the contexts, searching first to last, or undef if not. Path is something like

/foo/bar/0/baz/narf

and this will map to (depending on the object types in the context)

$context->{foo}->bar()->[0]->{baz}->narf();
process_string( string, contexts, plugins )

interprets 'string' as a string, and returns it. This includes variable interpolation from the contexts, for instance, the string

This is my ${weapon}!

Where the context is

{ weapon => "boomstick' }

will be interpolated properly. Both ${this} and $this style of placeholder will be interpolated.

process_not( value, contexts, plugins )

Evaluates 'value' as a TALES string in the context, and return the boolean value that is its opposite. eg

not:string:0 - true
not:/foo/bar - the opposite of /foo/bar

COPYRIGHT

Written by Tom Insam, Copyright 2005 Fotango Ltd. All Rights Reserved

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