PHP Класс LightnCandy\Runtime

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

Открытые методы

Метод Описание
debug ( string $v, string $f, array\arraystring | integer> $cx ) Output debug info.
enc ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $var ) : string For {{var}} .
encq ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $var ) : string For {{var}} , do html encode just like handlebars.js .
err ( array\arraystring | integer> $cx, string $err ) Handle error by error_log or throw exception.
hbch ( array\arraystring | integer> $cx, string $ch, arraystring | integer> | integer | null $vars, string $op, boolean $inverted, Closure | null $cb = null, Closure | null $else = null ) : string For custom helpers.
ifvar ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $v, boolean $zero ) : boolean For {{#if}} .
in ( array\arraystring | integer> &$cx, string $p, Closure $code ) For {{#* inlinepartial}} .
isec ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $v ) : boolean For {{^var}} .
lo ( array\arraystring | integer> $cx, string $v ) For {{log}} .
m ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $a, arraystring | integer> | integer | null $b ) : arraystring | integer> | integer Get merged context.
miss ( array\arraystring | integer> $cx, string $v ) Handle missing data error.
p ( array\arraystring | integer> $cx, string $p, arraystring | integer> | integer | null $v, $pid, $sp = '' ) : string For {{> partial}} .
sec ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $v, array | null $bp, arraystring | integer> | integer | null $in, boolean $each, Closure $cb, Closure | null $else = null ) : string For {{#var}} or {{#each}} .
v ( array\arraystring | integer> $cx, array | string | boolean | integer | double | null $in, arraystring | integer> $base, array $path, array | null $args = null ) : null | string Resursive lookup variable and helpers. This is slow and will only be used for instance property or method detection or lambdas.
wi ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $v, array | null $bp, arraystring | integer> | integer | null $in, Closure $cb, Closure | null $else = null ) : string For {{#with}} .

Описание методов

debug() публичный статический Метод

Output debug info.
public static debug ( string $v, string $f, array\arraystring | integer> $cx )
$v string expression
$f string runtime function name
$cx array\arraystring | integer>

enc() публичный статический Метод

For {{var}} .
public static enc ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $var ) : string
$cx array\arraystring | integer>
$var arraystring | integer> | integer | null
Результат string The htmlencoded value of the specified variable

encq() публичный статический Метод

For {{var}} , do html encode just like handlebars.js .
public static encq ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $var ) : string
$cx array\arraystring | integer>
$var arraystring | integer> | integer | null
Результат string The htmlencoded value of the specified variable

err() публичный статический Метод

Handle error by error_log or throw exception.
public static err ( array\arraystring | integer> $cx, string $err )
$cx array\arraystring | integer>
$err string error message

hbch() публичный статический Метод

For custom helpers.
public static hbch ( array\arraystring | integer> $cx, string $ch, arraystring | integer> | integer | null $vars, string $op, boolean $inverted, Closure | null $cb = null, Closure | null $else = null ) : string
$cx array\arraystring | integer>
$ch string the name of custom helper to be executed
$vars arraystring | integer> | integer | null
$op string the name of variable resolver. should be one of: 'raw', 'enc', or 'encq'.
$inverted boolean the logic will be inverted
$cb Closure | null callback function to render child context
$else Closure | null callback function to render child context when {{else}}
Результат string The rendered string of the token

ifvar() публичный статический Метод

For {{#if}} .
public static ifvar ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $v, boolean $zero ) : boolean
$cx array\arraystring | integer>
$v arraystring | integer> | integer | null
$zero boolean include zero as true
Результат boolean Return true when the value is not null nor false.

in() публичный статический Метод

For {{#* inlinepartial}} .
public static in ( array\arraystring | integer> &$cx, string $p, Closure $code )
$cx array\arraystring | integer>
$p string partial name
$code Closure the compiled partial code

isec() публичный статический Метод

For {{^var}} .
public static isec ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $v ) : boolean
$cx array\arraystring | integer>
$v arraystring | integer> | integer | null
Результат boolean Return true when the value is not null nor false.

lo() публичный статический Метод

For {{log}} .
public static lo ( array\arraystring | integer> $cx, string $v )
$cx array\arraystring | integer>
$v string expression

m() публичный статический Метод

Get merged context.
public static m ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $a, arraystring | integer> | integer | null $b ) : arraystring | integer> | integer
$cx array\arraystring | integer>
$a arraystring | integer> | integer | null
$b arraystring | integer> | integer | null
Результат arraystring | integer> | integer

miss() публичный статический Метод

Handle missing data error.
public static miss ( array\arraystring | integer> $cx, string $v )
$cx array\arraystring | integer>
$v string expression

p() публичный статический Метод

For {{> partial}} .
public static p ( array\arraystring | integer> $cx, string $p, arraystring | integer> | integer | null $v, $pid, $sp = '' ) : string
$cx array\arraystring | integer>
$p string partial name
$v arraystring | integer> | integer | null
Результат string The rendered string of the partial

sec() публичный статический Метод

For {{#var}} or {{#each}} .
public static sec ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $v, array | null $bp, arraystring | integer> | integer | null $in, boolean $each, Closure $cb, Closure | null $else = null ) : string
$cx array\arraystring | integer>
$v arraystring | integer> | integer | null
$bp array | null
$in arraystring | integer> | integer | null
$each boolean true when rendering #each
$cb Closure callback function to render child context
$else Closure | null callback function to render child context when {{else}}
Результат string The rendered string of the section

v() публичный статический Метод

Resursive lookup variable and helpers. This is slow and will only be used for instance property or method detection or lambdas.
public static v ( array\arraystring | integer> $cx, array | string | boolean | integer | double | null $in, arraystring | integer> $base, array $path, array | null $args = null ) : null | string
$cx array\arraystring | integer>
$in array | string | boolean | integer | double | null current context
$base arraystring | integer>
$path array
$args array | null extra arguments for lambda
Результат null | string Return the value or null when not found

wi() публичный статический Метод

For {{#with}} .
public static wi ( array\arraystring | integer> $cx, arraystring | integer> | integer | null $v, array | null $bp, arraystring | integer> | integer | null $in, Closure $cb, Closure | null $else = null ) : string
$cx array\arraystring | integer>
$v arraystring | integer> | integer | null
$bp array | null
$in arraystring | integer> | integer | null
$cb Closure callback function to render child context
$else Closure | null callback function to render child context when {{else}}
Результат string The rendered string of the token