Guides

GenIndexNode extends CompoundNode
in package

FinalYes

The genindex content for a page: a term tree collected and populated by IndexCollectorPass, either project-wide (the `:template: genindex` page) or -- when created by GenIndexDirective -- restricted to documents whose path starts with one of $pathPrefixes.

At parse time (when created by GenIndexDirective) this node is an empty placeholder; IndexCollectorPass fills in the real terms during compile, once the project-wide term data actually exists.

Table of Contents

Properties

$classes  : string[]
$options  : array<string, scalar|scalar[]|null>
$value  : TValue
$pathPrefixes  : array
$showLetterIndex  : bool

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
getMetaData()  : array<string, DataNode>
getOption()  : mixed
getOptions()  : array<string, scalar|scalar[]|null>
getPathPrefixes()  : string[]
getTerms()  : GenIndexTerm[]
getValue()  : TValue
hasOption()  : bool
pushChildNode()  : void
removeNode()  : static
replaceNode()  : static
setClasses()  : void
Normalizes class names following the rules of identifier-normalization
setValue()  : void
showLetterIndex()  : bool
Whether to group terms under an A-Z jumpbox + per-letter headings, or just list them flat. The letter grouping is of little use for a small list, e.g. a single changelog version's worth of terms.
withKeepExistingOptions()  : static
Adds $options as default options without overriding any options already set.
withOptions()  : static

Properties

$options

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

$pathPrefixes read-only

private array $pathPrefixes = []

$showLetterIndex read-only

private bool $showLetterIndex = true

Methods

__construct()

public __construct(GenIndexTerm[] $terms[, string[] $pathPrefixes = [] ][, bool $showLetterIndex = true ]) : mixed
Parameters
$terms : GenIndexTerm[]
$pathPrefixes : string[] = []

empty means unscoped (whole project)

$showLetterIndex : bool = true

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
string

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>

getPathPrefixes()

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

getValue()

public getValue() : TValue
Return values
TValue

hasOption()

public hasOption(string $name) : bool
Parameters
$name : string
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

setValue()

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

showLetterIndex()

Whether to group terms under an A-Z jumpbox + per-letter headings, or just list them flat. The letter grouping is of little use for a small list, e.g. a single changelog version's worth of terms.

public showLetterIndex() : bool
Return values
bool

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