PEEL Shopping
Open source ecommerce : PEEL Shopping
Public Member Functions | Protected Attributes
Twig_Node Class Reference

Represents a node in the AST. More...

Inheritance diagram for Twig_Node:
Twig_NodeInterface Twig_Node_AutoEscape Twig_Node_Block Twig_Node_BlockReference Twig_Node_Body Twig_Node_Do Twig_Node_Expression Twig_Node_Flush Twig_Node_For Twig_Node_ForLoop Twig_Node_If Twig_Node_Import Twig_Node_Include Twig_Node_Macro Twig_Node_Module Twig_Node_Print Twig_Node_Sandbox Twig_Node_Set Twig_Node_SetTemp Twig_Node_Spaceless Twig_Node_Text

Public Member Functions

 __construct (array $nodes=array(), array $attributes=array(), $lineno=0, $tag=null)
 Constructor. More...
 
 __toString ()
 
 toXml ($asDom=false)
 
 compile (Twig_Compiler $compiler)
 Compiles the node to PHP. More...
 
 getLine ()
 
 getNodeTag ()
 
 hasAttribute ($name)
 Returns true if the attribute is defined. More...
 
 getAttribute ($name)
 Gets an attribute. More...
 
 setAttribute ($name, $value)
 Sets an attribute. More...
 
 removeAttribute ($name)
 Removes an attribute. More...
 
 hasNode ($name)
 Returns true if the node with the given identifier exists. More...
 
 getNode ($name)
 Gets a node by name. More...
 
 setNode ($name, $node=null)
 Sets a node. More...
 
 removeNode ($name)
 Removes a node by name. More...
 
 count ()
 
 getIterator ()
 

Protected Attributes

 $nodes
 
 $attributes
 
 $lineno
 
 $tag
 

Detailed Description

Represents a node in the AST.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 18 of file Node.php.

Constructor & Destructor Documentation

__construct ( array  $nodes = array(),
array  $attributes = array(),
  $lineno = 0,
  $tag = null 
)

Constructor.

The nodes are automatically made available as properties ($this->node). The attributes are automatically made available as array items ($this['name']).

Parameters
array$nodesAn array of named nodes
array$attributesAn array of attributes (should not be nodes)
integer$linenoThe line number
string$tagThe tag name associated with the Node

Definition at line 36 of file Node.php.

Member Function Documentation

__toString ( )

Definition at line 44 of file Node.php.

compile ( Twig_Compiler  $compiler)

Compiles the node to PHP.

Parameters
Twig_CompilerA Twig_Compiler instance

Implements Twig_NodeInterface.

Definition at line 102 of file Node.php.

count ( )

Definition at line 217 of file Node.php.

getAttribute (   $name)

Gets an attribute.

Parameters
stringThe attribute name
Returns
mixed The attribute value

Definition at line 138 of file Node.php.

getIterator ( )

Definition at line 222 of file Node.php.

getLine ( )

Implements Twig_NodeInterface.

Definition at line 109 of file Node.php.

getNode (   $name)

Gets a node by name.

Parameters
stringThe node name
Returns
Twig_Node A Twig_Node instance

Definition at line 187 of file Node.php.

getNodeTag ( )

Implements Twig_NodeInterface.

Definition at line 114 of file Node.php.

hasAttribute (   $name)

Returns true if the attribute is defined.

Parameters
stringThe attribute name
Returns
Boolean true if the attribute is defined, false otherwise

Definition at line 126 of file Node.php.

hasNode (   $name)

Returns true if the node with the given identifier exists.

Parameters
stringThe node name
Returns
Boolean true if the node with the given name exists, false otherwise

Definition at line 175 of file Node.php.

removeAttribute (   $name)

Removes an attribute.

Parameters
stringThe attribute name

Definition at line 163 of file Node.php.

removeNode (   $name)

Removes a node by name.

Parameters
stringThe node name

Definition at line 212 of file Node.php.

setAttribute (   $name,
  $value 
)

Sets an attribute.

Parameters
stringThe attribute name
mixedThe attribute value

Definition at line 153 of file Node.php.

setNode (   $name,
  $node = null 
)

Sets a node.

Parameters
stringThe node name
Twig_NodeA Twig_Node instance

Definition at line 202 of file Node.php.

toXml (   $asDom = false)

Definition at line 72 of file Node.php.

Field Documentation

$attributes
protected

Definition at line 21 of file Node.php.

$lineno
protected

Definition at line 22 of file Node.php.

$nodes
protected

Definition at line 20 of file Node.php.

$tag
protected

Definition at line 23 of file Node.php.


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

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:44 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.