Bracket

Bracket parser

 class Winter\Storm\Parse\Bracket

Constants

Constant Description
CHAR_CLOSE
string "}"
CHAR_OPEN
string "{"

Properties

protected $options : array

Parsing options

Methods

public final __construct (array $options = [])

Parameters
Property Description
$options
array
Returns
mixed

public static parse (string $template, array $vars = [], array $options = []) : string

Static helper for new instances of this class.

Parameters
Property Description
$template
string
$vars
array
$options
array
Returns
string

public parseString (string $string, array $data) : string

Parse a string against data.

Parameters
Property Description
$string
string
$data
array
Returns
string

public setOptions (array $options = [])

Parameters
Property Description
$options
array
Returns
mixed

protected parseKey (string $key, string $value, string $string) : string

Process a single key

Parameters
Property Description
$key
string
$value
string
$string
string
Returns
string

protected parseKeyBooleans ($key, $value, $string)

This is an internally used method, the syntax is experimental and may change.

Parameters
Property Description
$key
mixed
$value
mixed
$string
mixed
Returns
mixed

protected parseKeyFilters (string $key, string $value, string $string) : string

Look for filtered variables and replace them

Parameters
Property Description
$key
string
$value
string
$string
string
Returns
string

protected parseLoop (string $key, array $data, string $string) : string

Search for open/close keys and process them in a nested fashion

Parameters
Property Description
$key
string
$data
array
$string
string
Returns
string

protected parseLoopRegex (string $string, string $key) : string[] | false

Internal method, returns a Regular expression for parsing a looping tag.

Parameters
Property Description
$string
string
$key
string
Returns
string[] | false
Copyright © 2024 Winter CMS