Class jTpl

Description

template engine

Located in /tpl/jTpl.class.php (line 17)


	
			
Variable Summary
Method Summary
static string getEncoding ()
jTpl __construct ()
void append (string|array $name, [mixed $value = null])
void appendZone (string $name, string $zoneName, [array $params = array()])
void assign (string|array $name, [mixed $value = null])
void assignByRef (string $name,  &$value, mixed $value)
void assignIfNone (string|array $name, [mixed $value = null])
void assignZone (string $name, string $zoneName, [array $params = array()])
void assignZoneIfNone (string $name, string $zoneName, [array $params = array()])
void display (string $tpl, [string $outputtype = ''], [boolean $trusted = true])
string fetch (string $tpl, [string $outputtype = ''], [boolean $trusted = true], [boolean $callMeta = true])
mixed get (string $name)
void getTemplate (string $tpl, string $fctname, [string $outputtype = ''], [boolean $trusted = true])
array getTemplateVars ()
boolean isAssigned (string $name)
void meta (string $tpl, [string $outputtype = ''], [boolean $trusted = true])
string metaFetch (string $tpl, [string $outputtype = ''], [boolean $trusted = true])
void registerFunction (string $name, string $functionName)
void registerModifier (string $name, string $functionName)
Variables
mixed $userFunctions = array() (line 291)
  • access: protected
mixed $userModifiers = array() (line 277)
  • access: protected
array $_meta = array() (line 42)

internal use It have a public access only for plugins. So you musn't use directly this property except from tpl plugins.

  • access: public
array $_privateVars = array () (line 34)

temporary template variables for plugins.

It have a public access only for plugins. So you musn't use directly this property except from tpl plugins.

  • access: public
string $_templateName (line 212)

contains the name of the template file It have a public access only for plugins. So you musn't use directly this property except from tpl plugins.

  • since: 1.1
  • access: public
array $_vars = array () (line 26)

all assigned template variables.

It have a public access only for plugins. So you musn't use directly this property except from tpl plugins. See methods of jTpl to manage template variables

  • access: public
Methods
static getEncoding (line 309)

return the current encoding

  • return: the charset string
  • since: 1.0b2
  • access: public
static string getEncoding ()
Constructor __construct (line 44)
  • access: public
jTpl __construct ()
append (line 82)

concat a value in with a value of an existing template variable

  • access: public
void append (string|array $name, [mixed $value = null])
  • string|array $name: the variable name, or an associative array 'name'=>'value'
  • mixed $value: the value (or null if $name is an array)
appendZone (line 134)

append a zone content to a template variable

void appendZone (string $name, string $zoneName, [array $params = array()])
  • string $name: the variable name
  • string $zoneName: a zone selector
  • array $params: parameters for the zone
assign (line 59)

assign a value in a template variable

  • access: public
void assign (string|array $name, [mixed $value = null])
  • string|array $name: the variable name, or an associative array 'name'=>'value'
  • mixed $value: the value (or null if $name is an array)
assignByRef (line 73)

assign a value by reference in a template variable

  • since: jelix 1.1
  • access: public
void assignByRef (string $name,  &$value, mixed $value)
  • string $name: the variable name
  • mixed $value: the value
  • &$value
assignIfNone (line 103)

assign a value in a template variable, only if the template variable doesn't exist

  • access: public
void assignIfNone (string|array $name, [mixed $value = null])
  • string|array $name: the variable name, or an associative array 'name'=>'value'
  • mixed $value: the value (or null if $name is an array)
assignZone (line 122)

assign a zone content to a template variable

void assignZone (string $name, string $zoneName, [array $params = array()])
  • string $name: the variable name
  • string $zoneName: a zone selector
  • array $params: parameters for the zone
assignZoneIfNone (line 148)

assign a zone content to a template variable only if this variable doesn't exist

void assignZoneIfNone (string $name, string $zoneName, [array $params = array()])
  • string $name: the variable name
  • string $zoneName: a zone selector
  • array $params: parameters for the zone
display (line 201)

display the generated content from the given template

  • access: public
void display (string $tpl, [string $outputtype = ''], [boolean $trusted = true])
  • string $tpl: template selector
  • string $outputtype: the type of output (html, text etc..)
  • boolean $trusted: says if the template file is trusted or not
fetch (line 239)

return the generated content from the given template

  • return: the generated content
  • access: public
string fetch (string $tpl, [string $outputtype = ''], [boolean $trusted = true], [boolean $callMeta = true])
  • string $tpl: template selector
  • string $outputtype: the type of output (html, text etc..)
  • boolean $trusted: says if the template file is trusted or not
  • boolean $callMeta: false if meta should not be called
get (line 167)

return the value of a template variable

  • return: the value (or null if it isn't exist)
  • access: public
mixed get (string $name)
  • string $name: the variable template name
getTemplate (line 221)

include the compiled template file and call one of the generated function

  • access: protected
void getTemplate (string $tpl, string $fctname, [string $outputtype = ''], [boolean $trusted = true])
  • string $tpl: template selector
  • string $fctname: the internal function name (meta or content)
  • string $outputtype: the type of output (html, text etc..)
  • boolean $trusted: says if the template file is trusted or not
getTemplateVars (line 180)

Return all template variables

  • access: public
array getTemplateVars ()
isAssigned (line 158)

says if a template variable exists

  • return: true if the variable exists
  • access: public
boolean isAssigned (string $name)
  • string $name: the variable template name
meta (line 190)

process all meta instruction of a template

  • access: public
void meta (string $tpl, [string $outputtype = ''], [boolean $trusted = true])
  • string $tpl: template selector
  • string $outputtype: the type of output (html, text etc..)
  • boolean $trusted: says if the template file is trusted or not
metaFetch (line 272)

deprecated function: optimized version of meta() + fetch().

Instead use fetch with true as $callMeta parameter.

  • return: the generated content
  • deprecated:
  • access: public
string metaFetch (string $tpl, [string $outputtype = ''], [boolean $trusted = true])
  • string $tpl: template selector
  • string $outputtype: the type of output (html, text etc..)
  • boolean $trusted: says if the template file is trusted or not
registerFunction (line 300)

register a user function. The function should accept a jTpl object as first parameter.

  • since: jelix 1.1
  • access: public
void registerFunction (string $name, string $functionName)
  • string $name: the name of the modifier in a template
  • string $functionName: the corresponding PHP function
registerModifier (line 287)

register a user modifier. The function should accept at least a string as first parameter, and should return this string which can be modified.

  • since: jelix 1.1
  • access: public
void registerModifier (string $name, string $functionName)
  • string $name: the name of the modifier in a template
  • string $functionName: the corresponding PHP function

Documentation generated on Thu, 22 Mar 2012 22:17:20 +0100 by phpDocumentor 1.4.3