eZ Publish  [trunk]
eZTemplatePHPOperator Class Reference

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

List of all members.

Public Member Functions

 eZTemplatePHPOperator ($php_names)
 modify ($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$value, $namedParameters, $placement)
 operatorList ()
 operatorTemplateHints ()
 phpOperatorTransformation ($operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters)

Public Attributes

 $Operators
 The array of operators, used for registering operators.
 $PHPNames
 The associative array of operator/php function redirection.

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" ) ) );

Definition at line 29 of file eztemplatephpoperator.php.


Member Function Documentation

Initializes the object with the redirection array.

Definition at line 34 of file eztemplatephpoperator.php.

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

Executes the PHP function for the operator $op_name.

Definition at line 93 of file eztemplatephpoperator.php.

Returns the template operators.

Definition at line 49 of file eztemplatephpoperator.php.

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

Definition at line 70 of file eztemplatephpoperator.php.


Member Data Documentation

eZTemplatePHPOperator::$Operators

The array of operators, used for registering operators.

Definition at line 104 of file eztemplatephpoperator.php.

eZTemplatePHPOperator::$PHPNames

The associative array of operator/php function redirection.

Definition at line 106 of file eztemplatephpoperator.php.


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