|
eZ Publish
[4.2]
|
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) | |
Public Attributes | |
| $AppendBlockName | |
| $BlockName | |
| Name of the function. | |
| $OnceName | |
| const | SCOPE_GLOBAL = 3 |
| const | SCOPE_RELATIVE = 1 |
| const | SCOPE_ROOT = 2 |
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}
{/set-block}
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}>
{/append-block}
run-once Makes sure that the block is run only once.
{run-once}
<p>This appears only one time</p>
{/run-once}
Definition at line 69 of file eztemplateblockfunction.php.
| eZTemplateBlockFunction::eZTemplateBlockFunction | ( | $ | blockName = 'set-block', |
| $ | appendBlockName = 'append-block', |
||
| $ | onceName = 'run-once' |
||
| ) |
Initializes the object with names.
Definition at line 78 of file eztemplateblockfunction.php.
| eZTemplateBlockFunction::functionList | ( | ) |
Returns an array containing the name of the block function, default is "block". The name is specified in the constructor.
Definition at line 91 of file eztemplateblockfunction.php.
| eZTemplateBlockFunction::functionTemplateHints | ( | ) |
Definition at line 96 of file eztemplateblockfunction.php.
| eZTemplateBlockFunction::hasChildren | ( | ) |
Returns true.
Definition at line 356 of file eztemplateblockfunction.php.
| eZTemplateBlockFunction::hasPlacementKey | ( | $ | key | ) |
Definition at line 340 of file eztemplateblockfunction.php.
Referenced by process().
| eZTemplateBlockFunction::placementKey | ( | $ | placement | ) |
Generates an md5 key from the start, stop and file of the template function and returns it.
Definition at line 323 of file eztemplateblockfunction.php.
Referenced by process(), and templateNodeTransformation().
| eZTemplateBlockFunction::process | ( | $ | tpl, |
| &$ | textElements, | ||
| $ | functionName, | ||
| $ | functionChildren, | ||
| $ | functionParameters, | ||
| $ | functionPlacement, | ||
| $ | rootNamespace, | ||
| $ | currentNamespace | ||
| ) |
Processes the function with all it's children.
Definition at line 205 of file eztemplateblockfunction.php.
| eZTemplateBlockFunction::registerPlacementKey | ( | $ | key, |
| $ | placement | ||
| ) |
Registers the placement key $key with the data $placement.
Definition at line 348 of file eztemplateblockfunction.php.
Referenced by process().
| eZTemplateBlockFunction::resetFunction | ( | $ | functionName | ) |
Definition at line 311 of file eztemplateblockfunction.php.
| eZTemplateBlockFunction::templateNodeTransformation | ( | $ | functionName, |
| &$ | node, | ||
| $ | tpl, | ||
| $ | parameters, | ||
| $ | privateData | ||
| ) |
Definition at line 114 of file eztemplateblockfunction.php.
| eZTemplateBlockFunction::$AppendBlockName |
Definition at line 364 of file eztemplateblockfunction.php.
| eZTemplateBlockFunction::$BlockName |
Name of the function.
Definition at line 363 of file eztemplateblockfunction.php.
| eZTemplateBlockFunction::$OnceName |
Definition at line 365 of file eztemplateblockfunction.php.
| const eZTemplateBlockFunction::SCOPE_GLOBAL = 3 |
Definition at line 73 of file eztemplateblockfunction.php.
Referenced by process().
| const eZTemplateBlockFunction::SCOPE_RELATIVE = 1 |
Definition at line 71 of file eztemplateblockfunction.php.
Referenced by process().
| const eZTemplateBlockFunction::SCOPE_ROOT = 2 |
Definition at line 72 of file eztemplateblockfunction.php.
Referenced by process().