|
P5EEx-Blue-0.01 | |||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||
![]() |
P5EEx::Blue::TemplateEngine::TemplateToolkit |
P5EEx::Blue::TemplateEngine::TemplateToolkit - Interface for rendering HTML templates using the Template Toolkit
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);
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.
* 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.
new()The constructor is inherited from
P5EEx::Blue::Service.
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);
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();
* Author: Stephen Adkins <stephen.adkins@officevision.com> * License: This is free software. It is licensed under the same terms as Perl itself.