Directive
in package
Attributes
- #[Attribute]
- \Attribute::TARGET_CLASS
Table of Contents
Properties
- $aliases : array
- $name : string
- $parseUndeclaredOptionsAsInlineMarkup : bool
- $rawContent : bool
- $valueType : DirectiveValueType
Methods
- __construct() : mixed
Properties
$aliases read-only
public
array
$aliases
= []
$name read-only
public
string
$name
$parseUndeclaredOptionsAsInlineMarkup read-only
public
bool
$parseUndeclaredOptionsAsInlineMarkup
= false
$rawContent read-only
public
bool
$rawContent
= false
$valueType read-only
public
DirectiveValueType
$valueType
= DirectiveValueType::Inline
Methods
__construct()
public
__construct(string $name[, string[] $aliases = [] ][, bool $rawContent = false ][, DirectiveValueType $valueType = DirectiveValueType::Inline ][, bool $parseUndeclaredOptionsAsInlineMarkup = false ]) : mixed
Parameters
- $name : string
- $aliases : string[] = []
- $rawContent : bool = false
-
If set, the directive's body is captured as literal source text (DirectiveNode::getRawContent()) instead of being parsed into child nodes -- for directives whose content isn't reStructuredText (e.g. raw HTML/LaTeX passthrough). Parsing such content as RST would corrupt it (e.g. a line that looks like a section title gets misinterpreted), so it's skipped entirely rather than parsed and discarded.
- $valueType : DirectiveValueType = DirectiveValueType::Inline
-
What kind of value this directive accepts right after
::-- see DirectiveValueType. Defaults to Inline, matching every directive's behavior before this was introduced: a non-empty value is always parsed as inline markup. - $parseUndeclaredOptionsAsInlineMarkup : bool = false
-
If set, options that are not declared with a #[Option] attribute are parsed as inline markup during parsing, just like options explicitly declared with OptionType::InlineMarkup. Useful for directives that accept arbitrary, free-form options (e.g. confval's additional fields).