class Template

Light template mechanism

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business
author Stefan Jelner (Optimizations)
version 1.0

 Methods

Template()

Template($tags) 
deprecated [2012-06-07] Old constructor function for downwards compatibility

Parameters

$tags

Constructor function

__construct($tags) : void
deprecated Class was renamed to cTemplate

Parameters

$tags

Generate the template and print/return it.

generate(string $template, bool $return, bool $note) : string
Inherited

(do translations sequentially to save memory!!!)

inherited_from \cTemplate::generate()

Parameters

$template

string

Either template string or template file path

$return

bool

Return or print template

$note

bool

Echo "Generated by ... " Comment

Returns

stringComplete Template string

Iterate internal counter by one

next() : void
Inherited
inherited_from \cTemplate::next()

Replaces a named function with the translated variant

replacei18n(string $template, string $functionName) : void
Inherited
inherited_from \cTemplate::replacei18n()

Parameters

$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 template data

reset() : void
Inherited
inherited_from \cTemplate::reset()

Set Templates placeholders and values

set(string $which, string $needle, string $replacement) : void
Inherited

With this method you can replace the placeholders in the static templates with dynamic data.

inherited_from \cTemplate::set()

Parameters

$which

string

's' for Static or else dynamic

$needle

string

Placeholder

$replacement

string

Replacement String

Sets the gettext domain to use for translations in a template

setDomain(string $sDomain) : void
Inherited
inherited_from \cTemplate::setDomain()

Parameters

$sDomain

string

Sets the domain to use for template translations

Sets an encoding for the template's head block.

setEncoding(string $encoding) : void
Inherited
inherited_from \cTemplate::setEncoding()

Parameters

$encoding

string

Encoding to set

 Properties

 

$Dyn_needles : array
Inherited
inherited_from \cTemplate::$$Dyn_needles
 

$Dyn_replacements : array
Inherited
inherited_from \cTemplate::$$Dyn_replacements
 

$dyn_cnt : int
Inherited
inherited_from \cTemplate::$$dyn_cnt
 

$needles : array
Inherited
inherited_from \cTemplate::$$needles
 

$replacements : array
Inherited
inherited_from \cTemplate::$$replacements
 

$tags : array
Inherited
inherited_from \cTemplate::$$tags
 

$_sDomain : string
Inherited
inherited_from \cTemplate::$$_sDomain