implements Phalcon\Di\InjectionAwareInterface
This class reads and compiles Volt templates into PHP plain code
$compiler = new \Phalcon\Mvc\View\Engine\Volt\Compiler(); $compiler->compile("views/partials/header.volt"); require $compiler->getCompiledTemplatePath();
Sets the dependency injector
Returns the internal dependency injector
Sets the compiler options
Sets a single compiler option
Returns a compiler’s option
Returns the compiler options
Fires an event to registered extensions
Registers a Volt’s extension
Returns the list of extensions registered in Volt
Register a new function in the compiler
Register the user registered functions
Register a new filter in the compiler
Register the user registered filters
Set a unique prefix to be used as prefix for compiled variables
Return a unique prefix to be used as prefix for compiled variables and contexts
Resolves attribute reading
Resolves function intermediate code into PHP function calls
Resolves filter intermediate code into a valid PHP expression
Resolves filter intermediate code into PHP function calls
Resolves an expression node in an AST volt tree
Compiles a block of statements
Compiles a “foreach” intermediate code representation into plain PHP code
Generates a ‘forelse’ PHP code
Compiles a ‘if’ statement returning PHP code
Compiles a “elseif” statement returning PHP code
Compiles a “cache” statement returning PHP code
Compiles a “set” statement returning PHP code
Compiles a “do” statement returning PHP code
Compiles a “return” statement returning PHP code
Compiles a “autoescape” statement returning PHP code
Compiles a ‘{{‘ ‘}}’ statement returning PHP code
Compiles a ‘include’ statement returning PHP code
Compiles macros
Compiles calls to macros
Traverses a statement list compiling each of its nodes
Compiles a Volt source code returning a PHP plain version
Compiles a template into a string
echo $compiler->compileString('{{ "hello world" }}');
Compiles a template into a file forcing the destination path
$compiler->compile("views/layouts/main.volt", "views/layouts/main.volt.php");
Compiles a template into a file applying the compiler options This method does not return the compiled path if the template was not compiled
$compiler->compile("views/layouts/main.volt"); require $compiler->getCompiledTemplatePath();
Returns the path that is currently being compiled
Returns the path to the last compiled template
Parses a Volt template returning its intermediate representation
print_r( $compiler->parse("{{ 3 + 2 }}") );
Gets the final path with VIEW
© 2011–2017 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/latest/api/Phalcon_Mvc_View_Engine_Volt_Compiler.html