PHP Class Essence\Utility\Template

Show file Open project: benjamminf/craft-embedded-assets Class Usage Examples

Public Methods

Method Description
compile ( string $template, array $variables, callable $filter = null ) : string Compiles a template with variables.

Protected Methods

Method Description
_compileFunction ( array $variables, callable | null $filter ) : Closure Returns a function used to replace variables by values.

Method Details

_compileFunction() protected static method

Returns a function used to replace variables by values.
See also: compile()
protected static _compileFunction ( array $variables, callable | null $filter ) : Closure
$variables array Variables.
$filter callable | null Filter function.
return Closure Function.

compile() public static method

Compiles a template with variables.
public static compile ( string $template, array $variables, callable $filter = null ) : string
$template string Template.
$variables array Variables.
$filter callable Filter function.
return string Compiled template.