Template::Context

Runtime context in which templates are processed
Download

Template::Context Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Andy Wardley
  • Publisher web site:
  • http://search.cpan.org/~abw/

Template::Context Tags


Template::Context Description

Runtime context in which templates are processed Template::Context is a runtime context in which templates are processed.SYNOPSIS use Template::Context; # constructor $context = Template::Context->new(\%config) || die $Template::Context::ERROR; # fetch (load and compile) a template $template = $context->template($template_name); # fetch (load and instantiate) a plugin object $plugin = $context->plugin($name, @args); # fetch (return or create) a filter subroutine $filter = $context->filter($name, @args, $alias); # process/include a template, errors are thrown via die() $output = $context->process($template, \%vars); $output = $context->include($template, \%vars); # raise an exception via die() $context->throw($error_type, $error_message, $output_buffer); # catch an exception, clean it up and fix output buffer $exception = $context->catch($exception, $output_buffer); # save/restore the stash to effect variable localisation $new_stash = $context->localise(\%vars); $old_stash = $context->delocalise(); # add new BLOCK or FILTER definitions $context->define_block($name, $block); $context->define_filter($name, &filtersub, $is_dynamic); # reset context, clearing any imported BLOCK definitions $context->reset(); # methods for accessing internal items $stash = $context->stash(); $tflag = $context->trim(); $epflag = $context->eval_perl(); $providers = $context->templates(); $providers = $context->plugins(); $providers = $context->filters(); ...The Template::Context module defines an object class for representing a runtime context in which templates are processed. It provides an interface to the fundamental operations of the Template Toolkit processing engine through which compiled templates (i.e. Perl code constructed from the template source) can process templates, load plugins and filters, raise exceptions and so on.A default Template::Context object is created by the Template module. Any Template::Context options may be passed to the Template new() constructor method and will be forwarded to the Template::Context constructor. Requirements: · Perl


Template::Context Related Software