PHP 클래스 LightnCandy\LightnCandy

상속: extends Flags
파일 보기 프로젝트 열기: zordius/lightncandy 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$lastParsed

보호된 프로퍼티들

프로퍼티 타입 설명
$lastContext

공개 메소드들

메소드 설명
compile ( string $template, array\arraystring | integer> $options = ['flags' => self::FLAG_BESTPERFORMANCE] ) : string | false Compile handlebars template into PHP code.
compilePartial ( string $template, array\arraystring | integer> $options = ['flags' => self::FLAG_BESTPERFORMANCE] ) : string | false Compile handlebars partial into PHP function code.
getContext ( ) : array\arraystring | integer> 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\arraystring | integer> &$context ) : boolean Handle exists error and return error status.

메소드 상세

compile() 공개 정적인 메소드

Compile handlebars template into PHP code.
public static compile ( string $template, array\arraystring | integer> $options = ['flags' => self::FLAG_BESTPERFORMANCE] ) : string | false
$template string handlebars template string
$options array\arraystring | integer>
리턴 string | false Compiled PHP code when successed. If error happened and compile failed, return false.

compilePartial() 공개 정적인 메소드

Compile handlebars partial into PHP function code.
public static compilePartial ( string $template, array\arraystring | integer> $options = ['flags' => self::FLAG_BESTPERFORMANCE] ) : string | false
$template string handlebars template string
$options array\arraystring | integer>
리턴 string | false Compiled PHP code when successed. If error happened and compile failed, return false.

getContext() 공개 정적인 메소드

Get last compiler context.
public static getContext ( ) : array\arraystring | integer>
리턴 array\arraystring | integer>

handleError() 보호된 정적인 메소드

Handle exists error and return error status.
protected static handleError ( array\arraystring | integer> &$context ) : boolean
$context array\arraystring | integer>
리턴 boolean True when error detected

prepare() 공개 정적인 메소드

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.
사용 중단:
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()

프로퍼티 상세

$lastContext 보호되어 있는 정적으로 프로퍼티

protected static $lastContext

$lastParsed 공개적으로 정적으로 프로퍼티

public static $lastParsed