eZPublish  3.9
eZTemplateBlockFunction Class Reference

Advanced block handling. More...

Public Member Functions

 eZTemplateBlockFunction ($blockName= 'set-block', $appendBlockName= 'append-block', $onceName= 'run-once')
 functionList ()
 functionTemplateHints ()
 hasChildren ()
 hasPlacementKey ($key)
 placementKey ($placement)
 process (&$tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace)
 registerPlacementKey ($key, $placement)
 resetFunction ($functionName)
 templateNodeTransformation ($functionName, &$node, &$tpl, $parameters, $privateData)

Private Attributes

 Name of the function. More...

Detailed Description

Advanced block handling.

set-block Renders all it's children as text and sets it as a template variable. This is useful for allowing one template to return multiple text portions, for instance an email template could set subject as a block and return the rest as body.

{set-block name=Space scope=global variable=text}
{$item} - {$item2}

append-block Similar to set-block but will make the variable an array where each append-block adds an item.

{append-block scope=global variable=extra_header_data}
<script language=jscript src={"/extension/xmleditor/dhtml/ezeditor.js"|ezroot}></script>
<link rel="stylesheet" type="text/css" href={"/extension/xmleditor/dhtml/toolbar.css"|ezroot}>

run-once Makes sure that the block is run only once.

<p>This appears only one time</p>

Member Function Documentation

eZTemplateBlockFunction::eZTemplateBlockFunction (   $blockName = 'set-block',
  $appendBlockName = 'append-block',
  $onceName = 'run-once' 

Initializes the object with names.

eZTemplateBlockFunction::functionList ( )

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

eZTemplateBlockFunction::functionTemplateHints ( )
eZTemplateBlockFunction::hasChildren ( )

Returns true.

eZTemplateBlockFunction::hasPlacementKey (   $key)
true if the placement key is registered which means that the block has already been run.

Referenced by process().

eZTemplateBlockFunction::placementKey (   $placement)

Generates an md5 key from the start, stop and file of the template function and returns it.

false if the key could not be made.

Referenced by process(), and templateNodeTransformation().

eZTemplateBlockFunction::process ( $tpl,

Processes the function with all it's children.

eZTemplateBlockFunction::registerPlacementKey (   $key,

Registers the placement key $key with the data $placement.

Referenced by process().

eZTemplateBlockFunction::resetFunction (   $functionName)
eZTemplateBlockFunction::templateNodeTransformation (   $functionName,

Member Data Documentation


Name of the function.


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