Template()
generate()
next()
replacei18n()
reset()
set()
setDomain()
setEncoding()
$Dyn_needles
$Dyn_replacements
$_sDomain
$db
$dyn_cnt
$needles
$replacements
$tags
class Template
Light template mechanism
author | Jan Lengowski <Jan.Lengowski@4fb.de> |
---|---|
copyright | four for business <http://www.4fb.de> |
author | Stefan Jelner (Optimizations) |
version | 1.0 |
Template($tags) : void
generate(\$template $template, \$return $return, \$note $note) : string
\$template
string/file Template
\$return
bool Return or print template
\$note
bool Echo "Generated by ... " Comment
string
complete Template stringnext() : void
replacei18n(\$template $template, \$functionName $functionName)
Replaces a named function with the translated variant
\$template
string Contents of the template to translate (it is reference to save memory!!!)
\$functionName
string Name of the translation function (e.g. i18n)
reset() : void
set(\$which $which, \$needle $needle, \$replacement $replacement) : void
With this method you can replace the placeholders in the static templates with dynamic data.
\$which
String 's' for Static or else dynamic
\$needle
String Placeholder
\$replacement
String Replacement String
setDomain(\$sDomain $sDomain) : \none
Sets the gettext domain to use for translations in a template
\$sDomain
string Sets the domain to use for template translations
\none
setEncoding(\$encoding $encoding)
\$encoding
string Encoding to set
$Dyn_needles : array
$Dyn_replacements : array
$_sDomain : string
$db : object
$dyn_cnt : int
$needles : array
$replacements : array