eZPublish  3.9
eZTemplateSectionFunction Class Reference

Advanced block handling in templates using function "section". More...

Public Member Functions

 attributeList ()
 eZTemplateSectionFunction ($name="section")
 functionList ()
 functionTemplateHints ()
 functionTemplateStatistics ($functionName, &$node, &$tpl, $resourceData, $namespace, &$stats)
 hasChildren ()
 process (&$tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace)
 templateNodeTransformation ($functionName, &$node, &$tpl, $parameters, $privateData)

Private Member Functions

 processChildren (&$textElements, &$children, $key, &$item, &$index, &$isFirstRun, &$delimiterStructure, &$sequenceStructure, &$filterStructure, &$tpl, $rootNamespace, $name, $functionPlacement, &$variableIterator, $noLastValue, &$iteratorData)
 processChildrenOnce (&$textElements, &$children, &$tpl, $rootNamespace, $name)

Private Attributes

 Name of the function. More...

Detailed Description

Advanced block handling in templates using function "section".

This class can be used in several different ways. It's primary use is for display an array of elements using the loop parameter. The array is iterated and the text of all the children are appended for each element. The current key and item is set in the namespace provided by the parameter name. If the paremeter sequence is supplied and it is an array it will be iterated and each element will be set in the variable sequence, when the end of the sequence is reached it is restarted.

// Example of template code
{* Loop 5 times *}
{section loop = 5}

Add these: {section name=adsfsdf sequence=array(234,234,23,4,234) loop=.. max=2 offset=0 exclude} {section-exclude check=id using=array(1,2,5)} {section-exclude check=array(class,id) using=array(1,2,5)} {section-include check=class_id using=array(1,2,5)}


{delimiter}asdfasdf{/delimiter} {/section}


{section loop=... max=10 offset=2} {/section}

Member Function Documentation

eZTemplateSectionFunction::attributeList ( )

Returns the attribute list which is delimiter and $name-else, where $name is the name of the function.

eZTemplateSectionFunction::eZTemplateSectionFunction (   $name = "section")

Initializes the object with a name, the name is required for determining the name of the -else tag.

eZTemplateSectionFunction::functionList ( )

Returns an array containing the name of the section function, default is "section". The name is specified in the constructor.

eZTemplateSectionFunction::functionTemplateHints ( )
eZTemplateSectionFunction::functionTemplateStatistics (   $functionName,
eZTemplateSectionFunction::hasChildren ( )

Returns true.

eZTemplateSectionFunction::process ( $tpl,

Processes the function with all it's children.

eZTemplateSectionFunction::processChildren ( $textElements,

Goes trough all children and process them into text. It will skip the processing if the current item is filtered away.

true if the element was processed, false otherwise.

Referenced by process().

eZTemplateSectionFunction::processChildrenOnce ( $textElements,

Goes trough all children and process them into text.


Referenced by process().

eZTemplateSectionFunction::templateNodeTransformation (   $functionName,

Member Data Documentation


Name of the function.

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