Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZTemplatePHPOperator Class Reference
Template system » Template operators

Makes it easy to add php functions as operators. More...

## Public Member Functions
| __construct ( $php_names)
| operatorList ()
| operatorTemplateHints ()
| phpOperatorTransformation ( $operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)
| modify ( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$value, $namedParameters, $placement)

## Public Attributes
| $Operators
| The array of operators, used for registering operators. More...
| $PHPNames
| The associative array of operator/php function redirection. More...

## Detailed Description

Makes it easy to add php functions as operators.

This class makes it easy to add existing PHP functions as template operators. It maps a template operator to a PHP function, the function must take one parameter and return the result. The redirection is done by supplying an associative array to the class, each key is the operatorname and the value is the PHP function name.

Example:

$tpl->registerOperators( new eZTemplatePHPOperator( array( "upcase" => "strtoupper",
"reverse" => "strrev" ) ) );
eZTemplatePHPOperator
Makes it easy to add php functions as operators.
Definition: eztemplatephpoperator.php:30

Definition at line 29 of file eztemplatephpoperator.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZTemplatePHPOperator::__construct | ( |  | $php_names | ) |

Initializes the object with the redirection array.

Parameters

  array | $php_names |

Definition at line 36 of file eztemplatephpoperator.php.

## Member Function Documentation

## ◆ modify()

eZTemplatePHPOperator::modify | ( |  | $tpl,
|  |  | $operatorName,
|  |  | $operatorParameters,
|  |  | $rootNamespace,
|  |  | $currentNamespace,
|  | & | $value,
|  |  | $namedParameters,
|  |  | $placement
| ) |  |

Executes the PHP function for the operator $op_name.

Definition at line 95 of file eztemplatephpoperator.php.

## ◆ operatorList()

eZTemplatePHPOperator::operatorList | ( |  | ) |

Returns the template operators.

Definition at line 51 of file eztemplatephpoperator.php.

References $Operators.

## ◆ operatorTemplateHints()

eZTemplatePHPOperator::operatorTemplateHints | ( |  | ) |

Definition at line 56 of file eztemplatephpoperator.php.

## ◆ phpOperatorTransformation()

eZTemplatePHPOperator::phpOperatorTransformation | ( |  | $operatorName,
|  | & | $node,
|  |  | $tpl,
|  | & | $resourceData,
|  |  | $element,
|  |  | $lastElement,
|  |  | $elementList,
|  |  | $elementTree,
|  | & | $parameters
| ) |  |

Definition at line 72 of file eztemplatephpoperator.php.

References eZTemplateNodeTool\createCodePieceElement().

## Member Data Documentation

## ◆ $Operators

eZTemplatePHPOperator::$Operators

The array of operators, used for registering operators.

Definition at line 106 of file eztemplatephpoperator.php.

Referenced by operatorList().

## ◆ $PHPNames

eZTemplatePHPOperator::$PHPNames

The associative array of operator/php function redirection.

Definition at line 108 of file eztemplatephpoperator.php.

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

- eztemplatephpoperator.php

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