Methods summary
public static
|
#
handleDynamic( & $context )
Include all partials when using dynamic partials
Include all partials when using dynamic partials
|
public static
string|null
|
#
read( array<string,array|string|integer> & $context, string $name )
Read partial file content as string and store in context
Read partial file content as string and store in context
Parameters
- $context
- Current context of compiler progress.
- $name
- partial name
Returns
string|null $code compiled PHP code when success
|
protected static
string|null
|
#
prePartial( array<string,array|string|integer> & $context, string $tmpl, string & $name )
preprocess partial template before it be stored into context
preprocess partial template before it be stored into context
Parameters
- $context
- Current context of compiler progress.
- $tmpl
- partial template
- $name
- partial name
Returns
string|null $content processed partial template
Expect
'hey' when input array('prepartial' => false), 'hey', 'haha'
'haha-hoho' when input array('prepartial' => function ($cx, $tmpl, $name) {return "$name-$tmpl";}), 'hoho', 'haha'
|
public static
string|null
|
#
resolve( array<string,array|string|integer> & $context, string & $name )
resolve partial, return the partial content
resolve partial, return the partial content
Parameters
- $context
- Current context of compiler progress.
- $name
- partial name
Returns
string|null $content partial content
|
public static
string|null
|
#
resolver( array<string,array|string|integer> & $context, string & $name )
use partialresolver to resolve partial, return the partial content
use partialresolver to resolve partial, return the partial content
Parameters
- $context
- Current context of compiler progress.
- $name
- partial name
Returns
string|null $content partial content
|
public static
string|null
|
#
compileStatic( array<string,array|string|integer> & $context, string $name )
compile a partial to static embed PHP code
compile a partial to static embed PHP code
Parameters
- $context
- Current context of compiler progress.
- $name
- partial name
Returns
string|null $code PHP code string
|
public static
string|null
|
#
compileDynamic( array<string,array|string|integer> & $context, string $name )
compile partial as closure, stored in context
compile partial as closure, stored in context
Parameters
- $context
- Current context of compiler progress.
- $name
- partial name
Returns
string|null $code compiled PHP code when success
|
public static
string
|
#
compile( array<string,array|string|integer> & $context, string $template, string|integer $name = 0 )
compile a template into a closure function
compile a template into a closure function
Parameters
- $context
- Current context of compiler progress.
- $template
- template string
- $name
- partial name or 0
Returns
string $code compiled PHP code
|