Guides

DocumentNode extends CompoundNode
in package

FinalYes

Table of Contents

Properties

$classes  : string[]
$options  : array<string, scalar|scalar[]|null>
$value  : TValue
$direction  : TextDirection|null
$documentEntry  : DocumentEntryNode|null
$documentPartNodes  : array<string, Node[]>
Nodes that can be rendered in a special section of the page like the menu or the footer
$filePath  : string
$footnoteTargets  : array<int, FootnoteTarget>
$hash  : string
$headerNodes  : MetadataNode[]
Header nodes are rendered in the head of a html page.
$isRoot  : bool
$language  : string|null
$lastReturnedAnonymousFootnoteNumber  : int
$links  : string[]
$maxFootnoteNumber  : int
$metaTitle  : string|null
$navigationTitle  : string|null
$orphan  : bool
$rootSectionEntry  : SectionEntryNode|null
$template  : string|null
$titleFound  : bool
$tocNodes  : TocNode[]
$variables  : (string|Node)[]
Variables are replacements in a document or project.

Methods

__construct()  : mixed
addChildNode()  : void
addDocumentPart()  : void
addFootnoteTarget()  : int
addHeaderNode()  : void
addMetaData()  : void
Attaches data about this node that is not part of its content.
addTocNode()  : void
addVariable()  : void
getChildren()  : TValue[]
getClasses()  : string[]
getClassesString()  : string
getDirection()  : TextDirection|null
getDocumentEntry()  : DocumentEntryNode
getDocumentPartNodes()  : array<string, Node[]>
getFilePath()  : string
getFootnoteTarget()  : FootnoteTarget|null
getFootnoteTargetAnonymous()  : FootnoteTarget|null
getFootnoteTargetByName()  : FootnoteTarget|null
getHash()  : string
getHeaderNodes()  : MetadataNode[]
getLanguage()  : string|null
getLink()  : string|null
getLoggerInformation()  : array<string, string>
getMetaData()  : array<string, DataNode>
getNavigationTitle()  : string|null
getNodes()  : array<int, F>
getOption()  : mixed
getOptions()  : array<string, scalar|scalar[]|null>
getPageTitle()  : string|null
getRootSectionEntry()  : SectionEntryNode|null
getTemplate()  : string|null
getTitle()  : TitleNode|null
getTocNodes()  : TocNode[]
getValue()  : TValue
getVariable()  : mixed
hasDocumentPart()  : bool
hasOption()  : bool
isOrphan()  : bool
isRoot()  : bool
isTitleFound()  : bool
pushChildNode()  : void
removeNode()  : static
replaceNode()  : static
setClasses()  : void
Normalizes class names following the rules of identifier-normalization
setDocumentEntry()  : DocumentNode
setLinks()  : void
setMetaTitle()  : void
setOrphan()  : DocumentNode
setRootSectionEntry()  : void
setTitleFound()  : void
setValue()  : void
withIsRoot()  : DocumentNode
withKeepExistingOptions()  : static
Adds $options as default options without overriding any options already set.
withOptions()  : static

Properties

$options

protected array<string, scalar|scalar[]|null> $options = []

$documentPartNodes

Nodes that can be rendered in a special section of the page like the menu or the footer

private array<string, Node[]> $documentPartNodes = []

$headerNodes

Header nodes are rendered in the head of a html page.

private MetadataNode[] $headerNodes = []

They contain metadata about the document.

$lastReturnedAnonymousFootnoteNumber

private int $lastReturnedAnonymousFootnoteNumber = -1

$navigationTitle

private string|null $navigationTitle = null

$variables

Variables are replacements in a document or project.

private (string|Node)[] $variables = []

The easiest example is the replace-directive that allows textual replacements in the document. But also other directives may be prefixed with a name to replace a certain value in the text.

Methods

__construct()

public __construct(string $hash, string $filePath) : mixed
Parameters
$hash : string
$filePath : string

addChildNode()

public addChildNode(TValue $node) : void
Parameters
$node : TValue

addDocumentPart()

public addDocumentPart(string $identifier, Node[] $nodes) : void
Parameters
$identifier : string
$nodes : Node[]

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

addVariable()

public addVariable(string $name, string|Node $value) : void
Parameters
$name : string
$value : string|Node

getChildren()

public getChildren() : TValue[]
Return values
TValue[]

getClasses()

public getClasses() : string[]
Return values
string[]

getClassesString()

public getClassesString() : string
Return values
string

getDocumentPartNodes()

public getDocumentPartNodes() : array<string, Node[]>
Return values
array<string, Node[]>

getFilePath()

public getFilePath() : string
Return values
string

getHash()

public getHash() : string
Return values
string

getLanguage()

public getLanguage() : string|null
Return values
string|null
public getLink(string $name) : string|null
Parameters
$name : string
Return values
string|null

getLoggerInformation()

public getLoggerInformation() : array<string, string>
Return values
array<string, string>

getNavigationTitle()

public getNavigationTitle() : string|null
Return values
string|null

getNodes()

public getNodes([class-string $nodeType = Node::class ]) : array<int, F>
Parameters
$nodeType : class-string = Node::class
Return values
array<int, F>

getOption()

public getOption(string $name[, TType|null $default = null ]) : mixed
Parameters
$name : string
$default : TType|null = null
Tags
phpstan-return

($default is null ? mixed|null: TType|null)

getOptions()

public getOptions() : array<string, scalar|scalar[]|null>
Return values
array<string, scalar|scalar[]|null>

getPageTitle()

public getPageTitle() : string|null
Return values
string|null

getTemplate()

public getTemplate() : string|null
Return values
string|null

getValue()

public getValue() : TValue
Return values
TValue

getVariable()

public getVariable(string $name, TType $default) : mixed
Parameters
$name : string
$default : TType
Tags
phpstan-return

TType|string|Node

hasDocumentPart()

public hasDocumentPart(string $identifier) : bool
Parameters
$identifier : string
Return values
bool

hasOption()

public hasOption(string $name) : bool
Parameters
$name : string
Return values
bool

isTitleFound()

public isTitleFound() : bool
Return values
bool

pushChildNode()

public pushChildNode(TValue $node) : void
Parameters
$node : TValue

removeNode()

public removeNode(int $key) : static
Parameters
$key : int
Return values
static

replaceNode()

public replaceNode(int $key, TValue $node) : static
Parameters
$key : int
$node : TValue
Return values
static
public setLinks(array<string, string> $links) : void
Parameters
$links : array<string, string>

setMetaTitle()

public setMetaTitle(string $metaTitle) : void
Parameters
$metaTitle : string

setTitleFound()

public setTitleFound(bool $titleFound) : void
Parameters
$titleFound : bool

setValue()

public setValue(TValue $value) : void
Parameters
$value : TValue

withKeepExistingOptions()

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
static

withOptions()

public withOptions(array<string, scalar|scalar[]|null> $options) : static
Parameters
$options : array<string, scalar|scalar[]|null>
Return values
static
On this page

Search results