PHP Класс LightnCandy\LightnCandy

Наследование: extends Flags
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$lastParsed

Защищенные свойства (Protected)

Свойство Тип Описание
$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