Expression
in package
LightnCandy Expression handler
Table of Contents
- analyze() : array<string|int, int|bool|array>
- Analyze an expression
- arrayString() : string
- Get string presentation for an array
- boolString() : string
- return 'true' or 'false' string.
- listString() : string
- Get string presentation for a string list
- toString() : string
- get normalized handlebars expression for a variable
Methods
analyze()
Analyze an expression
public
static analyze(array<string, array|string|int> $context, array<string|int, array|string|int> $var) : array<string|int, int|bool|array>
Parameters
- $context : array<string, array|string|int>
-
Current context
- $var : array<string|int, array|string|int>
-
variable parsed path
Tags
Return values
array<string|int, int|bool|array> —analyzed result
arrayString()
Get string presentation for an array
public
static arrayString(array<string|int, string> $list) : string
Parameters
- $list : array<string|int, string>
-
an array of variable names.
Tags
Return values
string —PHP array names string
boolString()
return 'true' or 'false' string.
public
static boolString(int $v) : string
Parameters
- $v : int
-
value
Tags
Return values
string —'true' when the value larger then 0
listString()
Get string presentation for a string list
public
static listString(array<string|int, string> $list) : string
Parameters
- $list : array<string|int, string>
-
an array of strings.
Tags
Return values
string —PHP list string
toString()
get normalized handlebars expression for a variable
public
static toString(int $levels, bool $spvar, array<string|int, string|int> $var) : string
Parameters
- $levels : int
-
trace N levels top parent scope
- $spvar : bool
-
is the path start with @ or not
- $var : array<string|int, string|int>
-
variable parsed path
Tags
Return values
string —normalized expression for debug display