public static
string|false
|
#
compile( string $template, array<string,array|string|integer> $options = array('flags' => self::FLAG_BESTPERFORMANCE) )
Compile handlebars template into PHP code.
Compile handlebars template into PHP code.
Parameters
- $template
- handlebars template string
- $options
- LightnCandy compile time and run time options, default is array('flags' => LightnCandy::FLAG_BESTPERFORMANCE)
Returns
string|false Compiled PHP code when successed. If error happened and compile failed, return false.
|
public static
string|false
|
#
compilePartial( string $template, array<string,array|string|integer> $options = array('flags' => self::FLAG_BESTPERFORMANCE) )
Compile handlebars partial into PHP function code.
Compile handlebars partial into PHP function code.
Parameters
- $template
- handlebars template string
- $options
- LightnCandy compile time and run time options, default is array('flags' => LightnCandy::FLAG_BESTPERFORMANCE)
Returns
string|false Compiled PHP code when successed. If error happened and compile failed, return false.
Expect
false when input '{{"}}', array('flags' => LightnCandy::FLAG_HANDLEBARS)
|
public static
array<string,array|string|integer>
|
#
getContext( )
Get last compiler context.
Get last compiler context.
Returns
array<string,array|string|integer> Context data
|
public static
Closure|false
|
#
prepare( string $php, string|null $tmpDir = null, boolean $delete = true )
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.
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.
Deprecated
Parameters
- $php
- PHP code
- $tmpDir
- Optional, change temp directory for php include file saved by prepare() when cannot include PHP code with data:// format.
- $delete
- Optional, delete temp php file when set to tru. Default is true, set it to false for debug propose
Returns
Closure|false result of include()
|