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.
See also: lithium\template\View
See also: lithium\template\view\adapter
Inheritance: extends lithium\core\StaticObject
Show 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.
See also: lithium\template\view\Compiler::$_processors
public static compile ( string $string ) : string
$string string The string to be preprocessed.
return string Processed string.

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 static 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