class OptionsArray extends Component

Parses a list of options.

Properties

array $options ArrayObj of selected options.

Methods

static mixed
parse(Parser $parser, TokensList $list, array $options = array())

No description

static string
build(mixed $component, array $options = array())

No description

string
__toString()

Builds the string representation of a component of this type.

from Component
__construct(array $options = array())

Constructor.

mixed
has(string $key, bool $getExpr = false)

Checks if it has the specified option and returns it value or true.

bool
remove(string $key)

Removes the option from the array.

merge(array|OptionsArray $options)

Merges the specified options with these ones. Values with same ID will be replaced.

bool
isEmpty()

Checks tf there are no options set.

Details

at line 50
static mixed parse(Parser $parser, TokensList $list, array $options = array())

Parameters

Parser $parser the parser that serves as context
TokensList $list the list of tokens that are being parsed
array $options parameters for parsing

Return Value

mixed

at line 279
static string build(mixed $component, array $options = array())

Parameters

mixed $component the component to be built
array $options parameters for building

Return Value

string

in Component at line 73
string __toString()

Builds the string representation of a component of this type.

Return Value

string

See also

at line 38
__construct(array $options = array())

Constructor.

Parameters

array $options The array of options. Options that have a value must be an array with at least two keys name and expr or value.

at line 308
mixed has(string $key, bool $getExpr = false)

Checks if it has the specified option and returns it value or true.

Parameters

string $key the key to be checked
bool $getExpr Gets the expression instead of the value. The value is the processed form of the expression.

Return Value

mixed

at line 330
bool remove(string $key)

Removes the option from the array.

Parameters

string $key the key to be removed

Return Value

bool whether the key was found and deleted or not

at line 355
merge(array|OptionsArray $options)

Merges the specified options with these ones. Values with same ID will be replaced.

Parameters

array|OptionsArray $options the options to be merged

at line 369
bool isEmpty()

Checks tf there are no options set.

Return Value

bool