Свойство | Тип | Описание | |
---|---|---|---|
$lastParsed |
Свойство | Тип | Описание | |
---|---|---|---|
$lastContext |
Метод | Описание | |
---|---|---|
compile ( string $template, array\array |
Compile handlebars template into PHP code. | |
compilePartial ( string $template, array\array |
Compile handlebars partial into PHP function code. | |
getContext ( ) : array\array |
Get last compiler context. | |
prepare ( string $php, string | null $tmpDir = null, boolean $delete = true ) : Closure | false | Get a working render function by a string of PHP code. This method may requires php setting allow_url_include=1 and allow_url_fopen=1 , or access right to tmp file system. |
Метод | Описание | |
---|---|---|
handleError ( array\array |
Handle exists error and return error status. |
public static compile ( string $template, array\array |
||
$template | string | handlebars template string |
$options | array\array |
|
Результат | string | false | Compiled PHP code when successed. If error happened and compile failed, return false. |
public static compilePartial ( string $template, array\array |
||
$template | string | handlebars template string |
$options | array\array |
|
Результат | string | false | Compiled PHP code when successed. If error happened and compile failed, return false. |
public static getContext ( ) : array\array |
||
Результат | array\array |
protected static handleError ( array\array |
||
$context | array\array |
|
Результат | boolean | True when error detected |
public static prepare ( string $php, string | null $tmpDir = null, boolean $delete = true ) : Closure | false | ||
$php | string | PHP code |
$tmpDir | string | null | Optional, change temp directory for php include file saved by prepare() when cannot include PHP code with data:// format. |
$delete | boolean | Optional, delete temp php file when set to tru. Default is true, set it to false for debug propose |
Результат | Closure | false | result of include() |