Bracket
in package
Bracket parser
Tags
Table of Contents
- CHAR_CLOSE = '}'
- CHAR_OPEN = '{'
- $options : array<string|int, mixed>
- __construct() : mixed
- parse() : self
- Static helper for new instances of this class.
- parseString() : string
- Parse a string against data
- setOptions() : mixed
- parseKey() : string
- Process a single key
- parseKeyBooleans() : mixed
- This is an internally used method, the syntax is experimental and may change.
- parseKeyFilters() : string
- Look for filtered variables and replace them
- parseLoop() : string
- Search for open/close keys and process them in a nested fashion
- parseLoopRegex() : string
- Internal method, returns a Regular expression for parsing a looping tag.
Constants
CHAR_CLOSE
public
mixed
CHAR_CLOSE
= '}'
CHAR_OPEN
public
mixed
CHAR_OPEN
= '{'
Properties
$options
protected
array<string|int, mixed>
$options
= ['encodeHtml' => false, 'newlineToBr' => false, 'filters' => []]
Parsing options
Methods
__construct()
public
__construct([mixed $options = [] ]) : mixed
Parameters
- $options : mixed = []
Return values
mixed —parse()
Static helper for new instances of this class.
public
static parse(string $template[, array<string|int, mixed> $vars = [] ][, array<string|int, mixed> $options = [] ]) : self
Parameters
- $template : string
- $vars : array<string|int, mixed> = []
- $options : array<string|int, mixed> = []
Return values
self —parseString()
Parse a string against data
public
parseString(string $string, array<string|int, mixed> $data) : string
Parameters
- $string : string
- $data : array<string|int, mixed>
Return values
string —setOptions()
public
setOptions([mixed $options = [] ]) : mixed
Parameters
- $options : mixed = []
Return values
mixed —parseKey()
Process a single key
protected
parseKey(string $key, string $value, string $string) : string
Parameters
- $key : string
- $value : string
- $string : string
Return values
string —parseKeyBooleans()
This is an internally used method, the syntax is experimental and may change.
protected
parseKeyBooleans(mixed $key, mixed $value, mixed $string) : mixed
Parameters
- $key : mixed
- $value : mixed
- $string : mixed
Return values
mixed —parseKeyFilters()
Look for filtered variables and replace them
protected
parseKeyFilters(string $key, string $value, string $string) : string
Parameters
- $key : string
- $value : string
- $string : string
Return values
string —parseLoop()
Search for open/close keys and process them in a nested fashion
protected
parseLoop(string $key, array<string|int, mixed> $data, string $string) : string
Parameters
- $key : string
- $data : array<string|int, mixed>
- $string : string
Return values
string —parseLoopRegex()
Internal method, returns a Regular expression for parsing a looping tag.
protected
parseLoopRegex(string $string, string $key) : string
Parameters
- $string : string
- $key : string