|
eZ Publish
[4.2]
|
Display of variable attributes using operator "attribute". More...
Public Member Functions | |
| eZTemplateAttributeOperator ($name="attribute") | |
| modify ($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters) | |
| namedParameterList () | |
| operatorList () | |
| operatorTemplateHints () | |
Public Attributes | |
| $Operators | |
| The array of operators, used for registering operators. | |
Private Member Functions | |
| displayVariable (&$value, $as_html, $show_values, $max, $cur_level, &$txt) | |
Display of variable attributes using operator "attribute".
This class allows for displaying template variable attributes. The display is recursive and the number of levels can be maximized.
The operator can take three parameters. The first is the maximum number of levels to recurse, if blank or omitted the maxium level is infinity. The second is the type of display, if set to "text" the output is as pure text otherwise as html. The third is whether to show variable values or not, default is to not show.
// Example template code // Display attributes of $myvar {$myvar|attribute} // Display 2 levels of $tree {$tree|attribute(2)} // Display attributes and values of $item {$item|attribute(,,show)}
Definition at line 58 of file eztemplateattributeoperator.php.
| eZTemplateAttributeOperator::displayVariable | ( | &$ | value, |
| $ | as_html, | ||
| $ | show_values, | ||
| $ | max, | ||
| $ | cur_level, | ||
| &$ | txt | ||
| ) | [private] |
Helper function for recursive display of attributes. $value is the current variable, $as_html is true if display as html, $max is the maximum number of levels, $cur_level the current level and $txt is the output text which the function adds to.
Definition at line 128 of file eztemplateattributeoperator.php.
Referenced by modify().
| eZTemplateAttributeOperator::eZTemplateAttributeOperator | ( | $ | name = "attribute" | ) |
Initializes the object with the name $name, default is "attribute".
Definition at line 63 of file eztemplateattributeoperator.php.
| eZTemplateAttributeOperator::modify | ( | $ | tpl, |
| $ | operatorName, | ||
| $ | operatorParameters, | ||
| $ | rootNamespace, | ||
| $ | currentNamespace, | ||
| &$ | operatorValue, | ||
| $ | namedParameters | ||
| ) |
Display the variable.
Definition at line 103 of file eztemplateattributeoperator.php.
| eZTemplateAttributeOperator::namedParameterList | ( | ) |
See eZTemplateOperator::namedParameterList()
Definition at line 87 of file eztemplateattributeoperator.php.
| eZTemplateAttributeOperator::operatorList | ( | ) |
Returns the template operators.
Definition at line 72 of file eztemplateattributeoperator.php.
| eZTemplateAttributeOperator::operatorTemplateHints | ( | ) |
Definition at line 77 of file eztemplateattributeoperator.php.
| eZTemplateAttributeOperator::$Operators |
The array of operators, used for registering operators.
Definition at line 216 of file eztemplateattributeoperator.php.