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
Afficher le fichier Open project: unionofrad/lithium Class Usage Examples

Protected Properties

Свойство 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.

Méthodes publiques

Méthode 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 méthode

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.
Résultat string Processed string.

template() public static méthode

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.
Résultat 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
Résultat array