class Twig_Compiler implements Twig_CompilerInterface
Compiles a node to PHP code.
Methods
|
__construct(Twig_Environment $env)
Constructor. |
||
| getFilename() | ||
| Twig_Environment |
getEnvironment()
Returns the environment instance related to this compiler. |
|
| string |
getSource()
Gets the current PHP code after compilation. |
|
| Twig_Compiler |
compile(Twig_NodeInterface $node, integer $indentation)
Compiles a node. |
|
| subcompile(Twig_NodeInterface $node, $raw = true) | ||
| Twig_Compiler |
raw(string $string)
Adds a raw string to the compiled code. |
|
| Twig_Compiler |
write()
Writes a string to the compiled code by adding indentation. |
|
| Twig_Compiler |
addIndentation()
Appends an indentation to the current PHP code after compilation. |
|
| Twig_Compiler |
string(string $value)
Adds a quoted string to the compiled code. |
|
| Twig_Compiler |
repr(mixed $value)
Returns a PHP representation of a given value. |
|
| Twig_Compiler |
addDebugInfo(Twig_NodeInterface $node)
Adds debugging information. |
|
| getDebugInfo() | ||
| Twig_Compiler |
indent(integer $step = 1)
Indents the generated code. |
|
| Twig_Compiler |
outdent(integer $step = 1)
Outdents the generated code. |
Details
at line 34
public
__construct(Twig_Environment $env)
Constructor.
at line 40
public
getFilename()
at line 50
public Twig_Environment
getEnvironment()
Returns the environment instance related to this compiler.
at line 60
public string
getSource()
Gets the current PHP code after compilation.
at line 73
public Twig_Compiler
compile(Twig_NodeInterface $node, integer $indentation)
Compiles a node.
at line 91
public
subcompile(Twig_NodeInterface $node, $raw = true)
at line 109
public Twig_Compiler
raw(string $string)
Adds a raw string to the compiled code.
at line 121
public Twig_Compiler
write()
Writes a string to the compiled code by adding indentation.
at line 137
public Twig_Compiler
addIndentation()
Appends an indentation to the current PHP code after compilation.
at line 151
public Twig_Compiler
string(string $value)
Adds a quoted string to the compiled code.
at line 165
public Twig_Compiler
repr(mixed $value)
Returns a PHP representation of a given value.
at line 207
public Twig_Compiler
addDebugInfo(Twig_NodeInterface $node)
Adds debugging information.
at line 230
public
getDebugInfo()
at line 242
public Twig_Compiler
indent(integer $step = 1)
Indents the generated code.
at line 256
public Twig_Compiler
outdent(integer $step = 1)
Outdents the generated code.