eZPublish  4.5
eZTemplateForeachFunction Class Reference

FOREACH loop. 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 = 'foreach'
 

Detailed Description

FOREACH loop.

Syntax:

{foreach <array> as [$keyVar =>] $itemVar
[sequence <array> as $sequenceVar]
[offset <offset>]
[max <max>]
[reverse]}
[{delimiter}...{/delimiter}]
[{break}]
[{continue}]
[{skip}]
{/foreach}

Example:

{foreach $objects as $object}
<tr>
{foreach $object.nodes as $node sequence array(dark,light) as $class}
<td class=$class>
{$node.name|wash}
</td>
{/foreach}
</tr>
{/foreach}

Member Function Documentation

eZTemplateForeachFunction::attributeList ( )

Returns the attribute list. key: parameter name value: can have children

& eZTemplateForeachFunction::functionList ( )

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

eZTemplateForeachFunction::functionTemplateHints ( )

Returns the array with hits for the template compiler.

eZTemplateForeachFunction::hasChildren ( )

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

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

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

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

Compiles the function and its children into PHP code.

Member Data Documentation

const eZTemplateForeachFunction::FUNCTION_NAME = 'foreach'

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