PHP Class LiquidContext, php-liquid

Afficher le fichier Open project: harrydeluxe/php-liquid Class Usage Examples

Méthodes publiques

Свойство Type Description
$environments array Global scopes
$registers array Registers for non-variable state data

Méthodes publiques

Méthode Description
__construct ( array $assigns = null, array $registers = [] ) Constructor
addFilters ( mixed $filter ) Add a filter to the context
fetch ( string $key ) : mixed Fetches the current key in all the scopes
get ( $key ) : mixed Replaces []
hasKey ( string $key ) : boolean Returns true if the given key will properly resolve
invoke ( string $name, mixed $value, array $args = null ) : string Invoke the filter that matches given name
merge ( array $newAssigns ) Merges the given assigns into the current assigns
pop ( ) : boolean Pops the current scope from the stack.
push ( ) : boolean Push new local scope on the stack.
resolve ( string $key ) : mixed Resolve a key by either returning the appropriate literal or by looking up the appropriate variable
set ( string $key, mixed $value, boolean $global = false ) Replaces []=
variable ( string $key ) : mixed Resolved the namespaced queries gracefully.

Method Details

__construct() public méthode

Constructor
public __construct ( array $assigns = null, array $registers = [] )
$assigns array
$registers array

addFilters() public méthode

Add a filter to the context
public addFilters ( mixed $filter )
$filter mixed

fetch() public méthode

Fetches the current key in all the scopes
public fetch ( string $key ) : mixed
$key string
Résultat mixed

get() public méthode

Replaces []
public get ( $key ) : mixed
Résultat mixed

hasKey() public méthode

Returns true if the given key will properly resolve
public hasKey ( string $key ) : boolean
$key string
Résultat boolean

invoke() public méthode

Invoke the filter that matches given name
public invoke ( string $name, mixed $value, array $args = null ) : string
$name string The name of the filter
$value mixed The value to filter
$args array Additional arguments for the filter
Résultat string

merge() public méthode

Merges the given assigns into the current assigns
public merge ( array $newAssigns )
$newAssigns array

pop() public méthode

Pops the current scope from the stack.
public pop ( ) : boolean
Résultat boolean

push() public méthode

Push new local scope on the stack.
public push ( ) : boolean
Résultat boolean

resolve() public méthode

Test for empty has been moved to interpret condition, in LiquidDecisionBlock
public resolve ( string $key ) : mixed
$key string
Résultat mixed

set() public méthode

Replaces []=
public set ( string $key, mixed $value, boolean $global = false )
$key string
$value mixed
$global boolean

variable() public méthode

Resolved the namespaced queries gracefully.
public variable ( string $key ) : mixed
$key string
Résultat mixed

Property Details

$environments public_oe property

Global scopes
public array $environments
Résultat array

$registers public_oe property

Registers for non-variable state data
public array $registers
Résultat array