Author: | Juti Noppornpitak |
---|
This package is used for rendering.
The default renderer with Jinja2
Parameters: | referers – the template module path (e.g., com.shiroyuki.view) or multiple base paths of Jinja templates based on the current working directory. |
---|
For example:
# Instantiate with the module path.
renderer = DefaultRenderer('app.views')
# Instantiate with multiple base paths of Jinja templates.
renderer = DefaultRenderer('/opt/app/ui/template', '/usr/local/tori/module/template')
See Renderer.render() for more information.
The abstract renderer for Tori framework.
Warning
This is a non-working renderer. To use the built-in renderer (with Jinja2), try DefaultRenderer. Otherwise, you should be expecting tori.exception.FutureFeatureException.
Render a template with context variables.
Parameters: |
|
---|---|
Return type: | string or unicode |
Example:
renderer = Renderer()
renderer.render('dummy.html', appname='ikayaki', version=1.0)
Author: | Juti Noppornpitaks |
---|---|
Restriction: | Internal Use Only |
The template repository used by Rendering Service.
Parameters: | class_reference (tori.template.service.RenderingService) – class reference |
---|
Note
This class is designed as a strict-type collection and may be refactored to the common area later on.
Retrieve the renderer by name.
Parameters: | renderer_name (string or unicode) – the name of the renderer. |
---|---|
Return type: | tori.template.renderer.Renderer |
Register the renderer.
Returns: | self |
---|
Author: | Juti Noppornpitak |
---|---|
Restriction: | Internal Use Only |
This package contains the rendering service. This is a module automatically loaded by tori.application.Application.
The rendering service allows the access to all template repositories.
This acts as a controller.
Parameters: |
|
---|
Register a renderer.
Parameters: | renderer (tori.template.renderer.Renderer) – the renderer |
---|---|
Returns: | self. |
Render a template from a repository repository_name.
As this method acts as a shortcut and wrapper to the actual renderer for the given repository, see tori.template.renderer.Renderer.render() for more information.
Return type: | string |
---|
Retrieve the renderer by name
Parameters: | repository_name (str) – the name of the repository |
---|---|
Return type: | tori.template.renderer.Renderer |