|
P5EEx-Blue-0.01 | |||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||
![]() |
P5EEx::Blue::TemplateEngine |
P5EEx::Blue::TemplateEngine - Interface for rendering HTML templates
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).
The following classes might be a part of the TemplateEngine Class Group.
A TemplateEngine Service is a means by which a template (such as an HTML template) may be rendered (with variables interpolated).
* Throws: P5EEx::Blue::Exception::TemplateEngine * Since: 0.01
...
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);
service_type()Returns 'TemplateEngine';
* Signature: $service_type = P5EEx::Blue::TemplateEngine->service_type();
* Param: void
* Return: $service_type string
* Since: 0.01
$service_type = $widget->service_type();
read_template()
* Signature: $template_text = $template_engine->read_template($template);
* Param: $template string
* Return: $template_text text
* Throws: P5EEx::Blue::Exception::TemplateEngine
* Since: 0.01
Sample Usage:
$template_text = $template_engine->read_template($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();
substitute()
* Signature: $text = $template_engine->substitute($template_text, $values);
* Param: $template_text string
* Param: $values {}
* Return: $text text
* Throws: P5EEx::Blue::Exception::TemplateEngine
* Since: 0.01
Sample Usage:
$text = $template_engine->substitute($template_text, $values);
This method substitutes (No subclass of this class need be used if the
* Author: Stephen Adkins <stephen.adkins@officevision.com> * License: This is free software. It is licensed under the same terms as Perl itself.