eZ Publish  [trunk]
eZTemplateDefFunction Class Reference

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

List of all members.

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}

Definition at line 37 of file eztemplatedeffunction.php.


Member Function Documentation

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

Definition at line 56 of file eztemplatedeffunction.php.

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

Definition at line 45 of file eztemplatedeffunction.php.

Returns the array with hits for the template compiler.

Definition at line 65 of file eztemplatedeffunction.php.

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

Definition at line 171 of file eztemplatedeffunction.php.

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

Actually executes the function (in processed mode).

Definition at line 127 of file eztemplatedeffunction.php.

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

Compiles the function into PHP code.

Definition at line 80 of file eztemplatedeffunction.php.


Member Data Documentation


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