PHP Class lithium\template\view\Compiler
It is possible to create your own template compiler and have the chosen
View adapter use that
instead. Please see the documentation on the dynamic dependencies of the adapter in question
to know more about how this can be achieved.
Mostra file
Open project: unionofrad/lithium
Class Usage Examples
Protected Properties
Property |
Type |
Description |
|
$_processors |
array |
Key/value pairs of regular expressions. The keys are the regexes, and the values are the
resulting expressions along with any capture groups that may have been used in the
corresponding regexes. |
|
Public Methods
Method |
Description |
|
compile ( string $string ) : string |
Preprocess the passed $string (usually a PHP template) for syntax replacements
using sets of regular expressions. |
|
template ( string $file, array $options = [] ) : string |
Compiles a template and writes it to a cache file, which is used for inclusion. |
|
Method Details
compile()
public static method
Preprocess the passed $string (usually a PHP template) for syntax replacements
using sets of regular expressions.
template()
public static method
Compiles a template and writes it to a cache file, which is used for inclusion.
public static template ( string $file, array $options = [] ) : string |
$file |
string |
The full path to the template that will be compiled. |
$options |
array |
Options for compilation include:
- `path`: Path where the compiled template should be written.
- `fallback`: Boolean indicating that if the compilation failed for some
reason (e.g. `path` is not writable), that the compiled template
should still be returned and no exception be thrown. |
return |
string |
The compiled template. |
Property Details
$_processors protected_oe static_oe property
Key/value pairs of regular expressions. The keys are the regexes, and the values are the
resulting expressions along with any capture groups that may have been used in the
corresponding regexes.
protected static array $_processors |
return |
array |
|