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])
string fetchFromString (string $tpl, [string $outputtype = ''], [boolean $trusted = true], [boolean $callMeta = true])
mixed get (string $name)
string getTemplate (string|jSelectorTpl $tpl, [string $outputtype = ''], [boolean $trusted = true])
array getTemplateVars ()
boolean isAssigned (string $name)
void meta (string $tpl, [string $outputtype = ''], [boolean $trusted = true])
void registerFunction (string $name, string $functionName)
void registerModifier (string $name, string $functionName)
Variables
mixed $processedMeta = array() (line 238)
  • access: protected
mixed $recursiveTpl = array() (line 237)
  • access: protected
mixed $userFunctions = array() (line 357)
  • access: protected
mixed $userModifiers = array() (line 343)
  • access: protected
array $_meta = array() (line 43)

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 35)

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 235)

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 27)

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 375)

return the current encoding

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

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 136)

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 61)

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 75)

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 105)

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 124)

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 150)

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 215)

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 262)

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
fetchFromString (line 304)

Return the generated content from the given string template (virtual)

  • return: the generated content
  • access: public
string fetchFromString (string $tpl, [string $outputtype = ''], [boolean $trusted = true], [boolean $callMeta = true])
  • string $tpl: template content
  • 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 169)

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 247)

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

  • return: the suffix name of the function to call
  • access: protected
string getTemplate (string|jSelectorTpl $tpl, [string $outputtype = ''], [boolean $trusted = true])
  • string|jSelectorTpl $tpl: template selector
  • string $outputtype: the type of output (html, text etc..)
  • boolean $trusted: says if the template file is trusted or not
getTemplateVars (line 182)

Return all template variables

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

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 192)

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
registerFunction (line 366)

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 353)

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 Mon, 26 Oct 2015 21:56:31 +0100 by phpDocumentor 1.4.3