Class jTpl

Description

template engine

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


	
			
Variable Summary
array $_meta
array $_vars
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 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])
Variables
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
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 259)

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

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

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)
assignIfNone (line 95)

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

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

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

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

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

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

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

Return all template variables

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

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

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

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

Documentation generated on Wed, 07 Sep 2011 13:48:07 +0200 by phpDocumentor 1.4.3