contenido\classes\class.template.php
Description: Contenido Template Engine
Requirements:
- Author
- Jan Lengowski
- Con_php_req
- 5.0
- Copyright
- four for business AG
- License
- http://www.contenido.org/license/LIZENZ.txt
- Link
- http://www.4fb.de
- Link
- http://www.contenido.org
- Package
- Contenido Backend classes
- Since
- file available since contenido release <= 4.6 {@internal created unknown modified 2008-06-30, Frederic Schneider, add security fix modified 2008-09-03 Timo Trautmann, DB Object is only created if necessary modified 2010-02-01 Ingo van Peeren, Removed deprecated functions and arrays because they are not used anymore $Id: class.template.php 1206 2010-09-08 20:29:12Z xmurrix $: }}
- Version
- 1.2.3
\Template
Light template mechanism
- Author
- Jan Lengowski
- Author
- Stefan Jelner (Optimizations)
- Copyright
- four for business
- Version
- 1.0
Properties


string $_sDomain = "contenido"
"contenido"
Details- Type
- string
Methods


generate( $template, $return = 0, $note = 0) : string
Generate the template and print/return it.
(do translations sequentially to save memory!!!)
Name | Type | Description |
---|---|---|
$template | string/file Template | |
$return | bool Return or print template | |
$note | bool Echo "Generated by ... " Comment |
Type | Description |
---|---|
string | complete Template string |


replacei18n( $template, $functionName) : void
replacei18n()
Replaces a named function with the translated variant
Name | Type | Description |
---|---|---|
$template | string Contents of the template to translate (it is reference to save memory!!!) | |
$functionName | string Name of the translation function (e.g. i18n) |


set( $which = 's', $needle, $replacement) : void
Set Templates placeholders and values
With this method you can replace the placeholders in the static templates with dynamic data.
Name | Type | Description |
---|---|---|
$which | String 's' for Static or else dynamic | |
$needle | String Placeholder | |
$replacement | String Replacement String |


setDomain( $sDomain) : \none
setDomain
Sets the gettext domain to use for translations in a template
Name | Type | Description |
---|---|---|
$sDomain | string Sets the domain to use for template translations |
Type | Description |
---|---|
\none |