Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | Private Member Functions | List of all members
eZTemplateSectionFunction Class Reference
Template system » Template functions

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

## Public Member Functions
| __construct ( $name="section")
| attributeList ()
| functionList ()
| functionTemplateHints ()
| templateNodeTransformation ( $functionName, &$node, $tpl, $parameters, $privateData)
| process ( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace)
| hasChildren ()

## Public Attributes
| $Name

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

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

Definition at line 57 of file eztemplatesectionfunction.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZTemplateSectionFunction::__construct | ( |  | $name = `"section"` | ) |

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

Parameters

  string | $name |

Definition at line 64 of file eztemplatesectionfunction.php.

## Member Function Documentation

## ◆ attributeList()

eZTemplateSectionFunction::attributeList | ( |  | ) |

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

Definition at line 73 of file eztemplatesectionfunction.php.

## ◆ functionList()

eZTemplateSectionFunction::functionList | ( |  | ) |

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

Definition at line 85 of file eztemplatesectionfunction.php.

## ◆ functionTemplateHints()

eZTemplateSectionFunction::functionTemplateHints | ( |  | ) |

Definition at line 90 of file eztemplatesectionfunction.php.

## ◆ hasChildren()

eZTemplateSectionFunction::hasChildren | ( |  | ) |

Returns true.

Definition at line 1058 of file eztemplatesectionfunction.php.

## ◆ process()

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

Processes the function with all it's children.

Definition at line 631 of file eztemplatesectionfunction.php.

References eZTemplate\NODE_FUNCTION, processChildren(), and processChildrenOnce().

## ◆ processChildren()

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.

Definition at line 947 of file eztemplatesectionfunction.php.

Referenced by process().

## ◆ processChildrenOnce()

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

Goes trough all children and process them into text.

Returns
  `true`.

Definition at line 931 of file eztemplatesectionfunction.php.

Referenced by process().

## ◆ templateNodeTransformation()

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

Definition at line 99 of file eztemplatesectionfunction.php.

References eZTemplateNodeTool\createCodePieceNode(), eZTemplateNodeTool\createNamespaceChangeNode(), eZTemplateNodeTool\createNamespaceRestoreNode(), eZTemplateNodeTool\createSpacingDecreaseNode(), eZTemplateNodeTool\createSpacingIncreaseNode(), eZTemplateNodeTool\createTextNode(), eZTemplateNodeTool\createVariableNode(), eZTemplateNodeTool\createVariableUnsetNode(), eZTemplateNodeTool\elementConstantValue(), eZTemplateNodeTool\extractFunctionNodeChildren(), eZTemplateNodeTool\extractFunctionNodeName(), eZTemplateNodeTool\extractFunctionNodeParameters(), eZTemplateNodeTool\extractFunctionNodePlacement(), eZTemplateNodeTool\extractNodes(), eZTemplateNodeTool\isConstantElement(), eZTemplate\NAMESPACE_SCOPE_RELATIVE, eZTemplate\NODE_FUNCTION, eZTemplateCompiler\processElementTransformationList(), and eZTemplateCompiler\processNodeTransformationNodes().

## Member Data Documentation

## ◆ $Name

eZTemplateSectionFunction::$Name

Name of the function

Definition at line 1065 of file eztemplatesectionfunction.php.

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

- eztemplatesectionfunction.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.