eZTemplateAttributeOperator Class Reference
[Template operators]

Display of variable attributes using operator "attribute". More...

List of all members.


Public Methods

 eZTemplateAttributeOperator ($name="attribute")
operatorList ()
 namedParameterList ()
 modify (&$tpl,&$operatorName,&$operatorParameters,&$rootNamespace,&$currentNamespace,&$operatorValue,&$namedParameters)

Public Attributes

 Operators
 The array of operators, used for registering operators.


Private Methods

 displayVariable (&$value,$as_html,$show_values,$max,$cur_level,&$txt)

Detailed Description

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


Constructor & Destructor Documentation

eZTemplateAttributeOperator::eZTemplateAttributeOperator   name = "attribute"
 

Initializes the object with the name $name, default is "attribute".

Definition at line eztemplateattributeoperator.php.

References Operators.


Member Function Documentation

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

Referenced by modify().

eZTemplateAttributeOperator::modify &$    tpl,
&$    operatorName,
&$    operatorParameters,
&$    rootNamespace,
&$    currentNamespace,
&$    operatorValue,
&$    namedParameters
 

Display the variable.

Definition at line eztemplateattributeoperator.php.

References displayVariable().

eZTemplateAttributeOperator::namedParameterList  
 

See eZTemplateOperator::namedParameterList()

Definition at line eztemplateattributeoperator.php.

& eZTemplateAttributeOperator::operatorList  
 

Returns the template operators.

Definition at line eztemplateattributeoperator.php.

References Operators.


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

Exponential