ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Twig_Node_Spaceless Class Reference

Represents a spaceless node. More...

+ Inheritance diagram for Twig_Node_Spaceless:
+ Collaboration diagram for Twig_Node_Spaceless:

Public Member Functions

 __construct (Twig_NodeInterface $body, $lineno, $tag='spaceless')
 
 compile (Twig_Compiler $compiler)
 Compiles the node to PHP. More...
 
- Public Member Functions inherited from Twig_Node
 __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...
 
 getTemplateLine ()
 
 getLine ()
 
 getNodeTag ()
 
 hasAttribute ($name)
 
 getAttribute ($name)
 
 setAttribute ($name, $value)
 
 removeAttribute ($name)
 
 hasNode ($name)
 
 getNode ($name)
 
 setNode ($name, $node=null)
 
 removeNode ($name)
 
 count ()
 
 getIterator ()
 
 setTemplateName ($name)
 
 getTemplateName ()
 
 setFilename ($name)
 
 getFilename ()
 

Additional Inherited Members

- Protected Attributes inherited from Twig_Node
 $nodes
 
 $attributes
 
 $lineno
 
 $tag
 

Detailed Description

Represents a spaceless node.

It removes spaces between HTML tags.

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

Definition at line 19 of file Spaceless.php.

Constructor & Destructor Documentation

◆ __construct()

Twig_Node_Spaceless::__construct ( Twig_NodeInterface  $body,
  $lineno,
  $tag = 'spaceless' 
)

Definition at line 21 of file Spaceless.php.

References Twig_Node\$lineno, Twig_Node\$tag, and array.

22  {
23  parent::__construct(array('body' => $body), array(), $lineno, $tag);
24  }
$lineno
Definition: Node.php:22
Create styles array
The data for the language used.

Member Function Documentation

◆ compile()

Twig_Node_Spaceless::compile ( Twig_Compiler  $compiler)

Compiles the node to PHP.

Implements Twig_NodeInterface.

Definition at line 26 of file Spaceless.php.

References Twig_Compiler\addDebugInfo(), and Twig_Node\getNode().

27  {
28  $compiler
29  ->addDebugInfo($this)
30  ->write("ob_start();\n")
31  ->subcompile($this->getNode('body'))
32  ->write("echo trim(preg_replace('/>\s+</', '><', ob_get_clean()));\n")
33  ;
34  }
getNode($name)
Definition: Node.php:186
addDebugInfo(Twig_NodeInterface $node)
Adds debugging information.
Definition: Compiler.php:212
+ Here is the call graph for this function:

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