eZPublish(LegacyStack)  5.1
eZTemplatePHPOperator Class Reference

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

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

Member Function Documentation

eZTemplatePHPOperator::eZTemplatePHPOperator (   $php_names)

Initializes the object with the redirection array.

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

Executes the PHP function for the operator $op_name.

eZTemplatePHPOperator::operatorList ( )

Returns the template operators.

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

Member Data Documentation

eZTemplatePHPOperator::$Operators

The array of operators, used for registering operators.

Referenced by operatorList().

eZTemplatePHPOperator::$PHPNames

The associative array of operator/php function redirection.


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