ReferenceNode
extends AbstractLinkInlineNode
in package
implements
CrossReferenceNode
FinalYes
CrossReferences are references outside a document. As parsing is file based normal references are in document, refering to other documents.
Supported formats
:ref:`link`
:ref:`custom text <link>`
Cross-references are resolved at the start of the rendering phase.
Table of Contents
Interfaces
- CrossReferenceNode
- A cross-reference node is a link node that can reference targets outside of the current document.
Constants
- TYPE : mixed = 'ref'
Properties
- $classes : string[]
- $options : array<string, scalar|scalar[]|null>
- $value : TValue
- $interlinkDomain : string
- $linkType : string
- $prefix : string
Methods
- __construct() : mixed
- addChildNode() : void
- addMetaData() : void
- Attaches data about this node that is not part of its content.
- getChildren() : TValue[]
- getClasses() : string[]
- getClassesString() : string
- getDebugInformation() : array<string, string>
- getInterlinkDomain() : string
- getInterlinkGroup() : string
- getLinkType() : string
- getMetaData() : array<string, DataNode>
- getOption() : mixed
- getOptions() : array<string, scalar|scalar[]|null>
- getPlainTextInlineNode() : self
- getPrefix() : string
- getTargetReference() : string
- getType() : string
- getUrl() : string
- getValue() : string
- hasOption() : bool
- pushChildNode() : void
-
removeNode()
: static
-
replaceNode()
: static
- setClasses() : void
- Normalizes class names following the rules of identifier-normalization
- setUrl() : void
- setValue() : void
- toString() : string
- withKeepExistingOptions() : static
- Adds $options as default options without overriding any options already set.
- withOptions() : static
Constants
TYPE
public
final mixed
TYPE
= 'ref'
Properties
$classes
protected
string[]
$classes
= []
$options
protected
array<string, scalar|scalar[]|null>
$options
= []
$value
protected
TValue
$value
$interlinkDomain read-only
private
string
$interlinkDomain
= ''
$linkType read-only
private
string
$linkType
= SectionNode::STD_LABEL
$prefix read-only
private
string
$prefix
= ''
Methods
__construct()
public
__construct(string $targetReference[, InlineNodeInterface[] $children = [] ][, string $interlinkDomain = '' ][, string $linkType = SectionNode::STD_LABEL ][, string $prefix = '' ]) : mixed
Parameters
- $targetReference : string
- $children : InlineNodeInterface[] = []
- $interlinkDomain : string = ''
- $linkType : string = SectionNode::STD_LABEL
- $prefix : string = ''
addChildNode()
public
addChildNode(TValue $node) : void
Parameters
- $node : TValue
addMetaData()
Attaches data about this node that is not part of its content.
public
addMetaData(DataNode $data) : void
Rendered as a data-* attribute where the node's template asks for
it. A name that is already taken gets the new values added to the ones
it has, rather than replaced by them. DataNode
Parameters
- $data : DataNode
getChildren()
public
getChildren() : TValue[]
Return values
TValue[]getClasses()
public
getClasses() : string[]
Return values
string[]getClassesString()
public
getClassesString() : string
Return values
stringgetDebugInformation()
public
getDebugInformation() : array<string, string>
Return values
array<string, string>getInterlinkDomain()
public
getInterlinkDomain() : string
Return values
stringgetInterlinkGroup()
public
getInterlinkGroup() : string
Return values
stringgetLinkType()
public
getLinkType() : string
Return values
stringgetMetaData()
public
getMetaData() : array<string, DataNode>
Return values
array<string, DataNode> —keyed by name
getOption()
public
getOption(string $name[, TType|null $default = null ]) : mixed
Parameters
- $name : string
- $default : TType|null = null
Tags
getOptions()
public
getOptions() : array<string, scalar|scalar[]|null>
Return values
array<string, scalar|scalar[]|null>getPlainTextInlineNode()
public
static getPlainTextInlineNode(string $content) : self
Parameters
- $content : string
Return values
selfgetPrefix()
public
getPrefix() : string
Return values
stringgetTargetReference()
public
getTargetReference() : string
Return values
stringgetType()
public
getType() : string
Return values
stringgetUrl()
public
getUrl() : string
Return values
stringgetValue()
public
getValue() : string
Return values
stringhasOption()
public
hasOption(string $name) : bool
Parameters
- $name : string
Return values
boolpushChildNode()
public
pushChildNode(TValue $node) : void
Parameters
- $node : TValue
removeNode()
public
removeNode(int $key) : static
Parameters
- $key : int
Return values
staticreplaceNode()
public
replaceNode(int $key, TValue $node) : static
Parameters
- $key : int
- $node : TValue
Return values
staticsetClasses()
Normalizes class names following the rules of identifier-normalization
public
setClasses(string[] $classes) : void
Parameters
- $classes : string[]
Tags
setUrl()
public
setUrl(string $url) : void
Parameters
- $url : string
setValue()
public
setValue(InlineNodeInterface[]|string $value) : void
Parameters
- $value : InlineNodeInterface[]|string
toString()
public
abstract toString() : string
Return values
stringwithKeepExistingOptions()
Adds $options as default options without overriding any options already set.
public
withKeepExistingOptions(array<string, scalar|null> $options) : static
Parameters
- $options : array<string, scalar|null>
Return values
staticwithOptions()
public
withOptions(array<string, scalar|scalar[]|null> $options) : static
Parameters
- $options : array<string, scalar|scalar[]|null>