eZPublish  4.5
eZTemplateDefFunction Class Reference

Allows to define/undefine template variables in any place. More...

Public Member Functions

 attributeList ()
 
functionList ()
 
 functionTemplateHints ()
 
 hasChildren ()
 
 process ($tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace)
 
 templateNodeTransformation ($functionName, &$node, $tpl, &$parameters, $privateData)
 

Public Attributes

const DEF_FUNCTION_NAME = 'def'
 
const UNDEF_FUNCTION_NAME = 'undef'
 

Detailed Description

Allows to define/undefine template variables in any place.

This class allows to execute on of two or more code pieces depending on a condition.

Syntax:

{def $var1=<value1> [$var2=<value2> ...]}

Example:

{def $i=10 $j=20}
{def $s1='hello' $s2='world'}
...
{set $i=$i+1}
...
{undef $i}
{undef $s1 $s2}
{undef}

Member Function Documentation

eZTemplateDefFunction::attributeList ( )

Returns the attribute list which is 'delimiter', 'elseif' and 'else'. key: parameter name value: can have children

& eZTemplateDefFunction::functionList ( )

Returns an array of the function names, required for eZTemplate::registerFunctions.

eZTemplateDefFunction::functionTemplateHints ( )

Returns the array with hits for the template compiler.

eZTemplateDefFunction::hasChildren ( )

Returns false, telling the template parser that the function cannot have children.

eZTemplateDefFunction::process (   $tpl,
$textElements,
  $functionName,
  $functionChildren,
  $functionParameters,
  $functionPlacement,
  $rootNamespace,
  $currentNamespace 
)

Actually executes the function (in processed mode).

eZTemplateDefFunction::templateNodeTransformation (   $functionName,
$node,
  $tpl,
$parameters,
  $privateData 
)

Compiles the function into PHP code.

Member Data Documentation

const eZTemplateDefFunction::DEF_FUNCTION_NAME = 'def'
const eZTemplateDefFunction::UNDEF_FUNCTION_NAME = 'undef'

The documentation for this class was generated from the following file: