eZPublishCommunityProject(LegacyStack)  2013.5
eZTemplateSectionFunction Class Reference

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

Public Member Functions

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

Public Attributes

 $Name
 Name of the function. More...
 

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)
 

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}
{$item}
{/section}

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)}

asdfasdf

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

{$module.features.list(5,array(2,5))}

{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::hasChildren ( )

Returns true.

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

Processes the function with all it's children.

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

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

Returns
true if the element was processed, false otherwise.

Referenced by process().

eZTemplateSectionFunction::processChildrenOnce ( $textElements,
$children,
  $tpl,
  $rootNamespace,
  $name 
)
private

Goes trough all children and process them into text.

Returns
true.

Referenced by process().

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

Member Data Documentation

eZTemplateSectionFunction::$Name

Name of the function.


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