P5EEx-Blue-0.01

P5EEx::Blue::TemplateEngine::TemplateToolkit


NAME

P5EEx::Blue::TemplateEngine::TemplateToolkit - Interface for rendering HTML templates using the Template Toolkit


SYNOPSIS

    use P5EEx::Blue::P5EE;
    $context = P5EEx::Blue::P5EE->context();
    $template_engine = $context->service("TemplateEngine");  # or ...
    $template_engine = $context->template_engine();
    $template = "index.html";
    $text = $template_engine->render($template);


DESCRIPTION

A TemplateEngine Service is a means by which a template (such as an HTML template) may be rendered (with variables interpolated).

This implementation does the rendering using the Template Toolkit.


Class: P5EEx::Blue::TemplateEngine

 * Throws: P5EEx::Blue::Exception::TemplateEngine
 * Since:  0.01

A TemplateEngine Service is a means by which a template (such as an HTML template) may be rendered (with variables interpolated).

This implementation does the rendering using the Template Toolkit.


Constructor Methods:

new()

The constructor is inherited from P5EEx::Blue::Service.


Public Methods:

render()

    * Signature: $text = $template_engine->render($template);
    * Param:     $template          string
    * Return:    $text              text
    * Throws:    P5EEx::Blue::Exception::TemplateEngine
    * Since:     0.01
    Sample Usage:
    $text = $template_engine->render($template);


Protected Methods:

prepare_values()

    * Signature: $values = $template_engine->prepare_values();
    * Param:     void
    * Return:    $values            {}
    * Throws:    P5EEx::Blue::Exception::TemplateEngine
    * Since:     0.01
    Sample Usage:
    $values = $template_engine->prepare_values();


ACKNOWLEDGEMENTS

 * Author:  Stephen Adkins <stephen.adkins@officevision.com>
 * License: This is free software. It is licensed under the same terms as Perl itself.


SEE ALSO

P5EEx::Blue::Context, P5EEx::Blue::Service