eZTemplatePHPOperator Class Reference
[Template operators]

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

List of all members.


Public Methods

 eZTemplatePHPOperator ($php_names)
operatorList ()
 modify (&$tpl,&$operatorName,&$operatorParameters,&$rootNamespace,&$currentNamespace,&$value)

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 eztemplatephpoperator.php.


Constructor & Destructor Documentation

eZTemplatePHPOperator::eZTemplatePHPOperator   php_names
 

Initializes the object with the redirection array.

Definition at line eztemplatephpoperator.php.

References PHPNames.


Member Function Documentation

eZTemplatePHPOperator::modify &$    tpl,
&$    operatorName,
&$    operatorParameters,
&$    rootNamespace,
&$    currentNamespace,
&$    value
 

Executes the PHP function for the operator $op_name.

Definition at line eztemplatephpoperator.php.

References PHPNames.

& eZTemplatePHPOperator::operatorList  
 

Returns the template operators.

Definition at line eztemplatephpoperator.php.

References Operators.


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

Exponential