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

Compiles a node to PHP code. More...

Inheritance diagram for Twig_Compiler:
Twig_CompilerInterface

Public Member Functions

 __construct (Twig_Environment $env)
 Constructor. More...
 
 getFilename ()
 
 getEnvironment ()
 Returns the environment instance related to this compiler. More...
 
 getSource ()
 Gets the current PHP code after compilation. More...
 
 compile (Twig_NodeInterface $node, $indentation=0)
 Compiles a node. More...
 
 subcompile (Twig_NodeInterface $node, $raw=true)
 
 raw ($string)
 Adds a raw string to the compiled code. More...
 
 write ()
 Writes a string to the compiled code by adding indentation. More...
 
 addIndentation ()
 Appends an indentation to the current PHP code after compilation. More...
 
 string ($value)
 Adds a quoted string to the compiled code. More...
 
 repr ($value)
 Returns a PHP representation of a given value. More...
 
 addDebugInfo (Twig_NodeInterface $node)
 Adds debugging information. More...
 
 getDebugInfo ()
 
 indent ($step=1)
 Indents the generated code. More...
 
 outdent ($step=1)
 Outdents the generated code. More...
 
- Public Member Functions inherited from Twig_CompilerInterface
 compile (Twig_NodeInterface $node)
 Compiles a node. More...
 

Protected Attributes

 $lastLine
 
 $source
 
 $indentation
 
 $env
 
 $debugInfo
 
 $sourceOffset
 
 $sourceLine
 
 $filename
 

Detailed Description

Compiles a node to PHP code.

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

Definition at line 18 of file Compiler.php.

Constructor & Destructor Documentation

__construct ( Twig_Environment  $env)

Constructor.

Parameters
Twig_Environment$envThe twig environment instance

Definition at line 34 of file Compiler.php.

Member Function Documentation

addDebugInfo ( Twig_NodeInterface  $node)

Adds debugging information.

Parameters
Twig_NodeInterface$nodeThe related twig node
Returns
Twig_Compiler The current compiler instance

Definition at line 207 of file Compiler.php.

addIndentation ( )

Appends an indentation to the current PHP code after compilation.

Returns
Twig_Compiler The current compiler instance

Definition at line 137 of file Compiler.php.

compile ( Twig_NodeInterface  $node,
  $indentation = 0 
)

Compiles a node.

Parameters
Twig_NodeInterface$nodeThe node to compile
integer$indentationThe current indentation
Returns
Twig_Compiler The current compiler instance

Definition at line 73 of file Compiler.php.

getDebugInfo ( )

Definition at line 230 of file Compiler.php.

getEnvironment ( )

Returns the environment instance related to this compiler.

Returns
Twig_Environment The environment instance

Definition at line 50 of file Compiler.php.

getFilename ( )

Definition at line 40 of file Compiler.php.

getSource ( )

Gets the current PHP code after compilation.

Returns
string The PHP code

Implements Twig_CompilerInterface.

Definition at line 60 of file Compiler.php.

indent (   $step = 1)

Indents the generated code.

Parameters
integer$stepThe number of indentation to add
Returns
Twig_Compiler The current compiler instance

Definition at line 242 of file Compiler.php.

outdent (   $step = 1)

Outdents the generated code.

Parameters
integer$stepThe number of indentation to remove
Returns
Twig_Compiler The current compiler instance

Definition at line 256 of file Compiler.php.

raw (   $string)

Adds a raw string to the compiled code.

Parameters
string$stringThe string
Returns
Twig_Compiler The current compiler instance

Definition at line 109 of file Compiler.php.

repr (   $value)

Returns a PHP representation of a given value.

Parameters
mixed$valueThe value to convert
Returns
Twig_Compiler The current compiler instance

Definition at line 165 of file Compiler.php.

string (   $value)

Adds a quoted string to the compiled code.

Parameters
string$valueThe string
Returns
Twig_Compiler The current compiler instance

Definition at line 151 of file Compiler.php.

subcompile ( Twig_NodeInterface  $node,
  $raw = true 
)

Definition at line 91 of file Compiler.php.

write ( )

Writes a string to the compiled code by adding indentation.

Returns
Twig_Compiler The current compiler instance

Definition at line 121 of file Compiler.php.

Field Documentation

$debugInfo
protected

Definition at line 24 of file Compiler.php.

$env
protected

Definition at line 23 of file Compiler.php.

$filename
protected

Definition at line 27 of file Compiler.php.

$indentation
protected

Definition at line 22 of file Compiler.php.

$lastLine
protected

Definition at line 20 of file Compiler.php.

$source
protected

Definition at line 21 of file Compiler.php.

$sourceLine
protected

Definition at line 26 of file Compiler.php.

$sourceOffset
protected

Definition at line 25 of file Compiler.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.