Directive
in package
FinalYes
Represents the data contained in an arbitrary directive
.. name:: data :option: value :option2: value 2
A directive can be saved into a variable, the data can be empty:
.. |variable| name::
Table of Contents
Properties
- $data : string
- $dataNode : InlineCompoundNode|null
- $name : string
- $options : array<string|int, mixed>
- $variable : string
Methods
- __construct() : mixed
- addOption() : void
- getData() : string
- getDataNode() : InlineCompoundNode|null
- getName() : string
- getOption() : DirectiveOption
- getOptionBool() : bool
- getOptionInt() : int
- getOptions() : array<string|int, DirectiveOption>
- getOptionString() : string
- getVariable() : string
- hasOption() : bool
- setDataNode() : void
Properties
$data read-only
private
string
$data
$dataNode
private
InlineCompoundNode|null
$dataNode
= null
$name read-only
private
string
$name
$options
private
array<string|int, mixed>
$options
= []
$variable read-only
private
string
$variable
Methods
__construct()
public
__construct(string $variable, string $name, string $data[, array<string|int, DirectiveOption> $options = [] ]) : mixed
Parameters
- $variable : string
- $name : string
- $data : string
- $options : array<string|int, DirectiveOption> = []
addOption()
public
addOption(DirectiveOption $value) : void
Parameters
- $value : DirectiveOption
getData()
public
getData() : string
Return values
stringgetDataNode()
public
getDataNode() : InlineCompoundNode|null
Return values
InlineCompoundNode|nullgetName()
public
getName() : string
Return values
stringgetOption()
public
getOption(string $name) : DirectiveOption
Parameters
- $name : string
Return values
DirectiveOptiongetOptionBool()
public
getOptionBool(string $name[, bool $default = false ][, bool $nullDefault = true ]) : bool
Parameters
- $name : string
- $default : bool = false
- $nullDefault : bool = true
Return values
boolgetOptionInt()
public
getOptionInt(string $name[, int $default = 0 ]) : int
Parameters
- $name : string
- $default : int = 0
Return values
intgetOptions()
public
getOptions() : array<string|int, DirectiveOption>
Return values
array<string|int, DirectiveOption>getOptionString()
public
getOptionString(string $name[, string $default = '' ]) : string
Parameters
- $name : string
- $default : string = ''
Return values
stringgetVariable()
public
getVariable() : string
Return values
stringhasOption()
public
hasOption(string $name) : bool
Parameters
- $name : string
Return values
boolsetDataNode()
public
setDataNode(InlineCompoundNode|null $dataNode) : void
Parameters
- $dataNode : InlineCompoundNode|null