eZPublish  4.5
eZTemplateIfFunction Class Reference

Conditional execution in templates. 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 FUNCTION_NAME = 'if'

Detailed Description

Conditional execution in templates.

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


{if <condition>}
[{elseif <condition>}]


{if eq( $var, true() )}
Hello world
No world here, move along.

Member Function Documentation

eZTemplateIfFunction::attributeList ( )

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

& eZTemplateIfFunction::functionList ( )

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

eZTemplateIfFunction::functionTemplateHints ( )

Returns the array with hits for the template compiler.

eZTemplateIfFunction::hasChildren ( )

Returns true, telling the template parser that the function can have children.

eZTemplateIfFunction::process (   $tpl,

Actually executes the function and its children (in processed mode).

eZTemplateIfFunction::templateNodeTransformation (   $functionName,

Compiles the function and its children into PHP code.

Member Data Documentation

const eZTemplateIfFunction::FUNCTION_NAME = 'if'

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