Guides

TableNode extends CompoundNode
in package

FinalYes

The cells of the header rows and then of the data rows are the children of the table, so that the compiler processes their content, such as the directives that are created at compile time.

Table of Contents

Properties

$classes  : string[]
$columnWidth  : array
$data  : array
$headers  : array
$options  : array<string, scalar|scalar[]|null>
$value  : TValue

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
getCols()  : int
getColumnWidth()  : int[]
getData()  : TableRow[]
getHeaders()  : TableRow[]
getMetaData()  : array<string, DataNode>
getOption()  : mixed
getOptions()  : array<string, scalar|scalar[]|null>
getRows()  : int
getValue()  : TValue
hasOption()  : bool
pushChildNode()  : void
removeNode()  : static
A table keeps its shape: a removed cell becomes an empty cell of the same size.
replaceNode()  : static
setClasses()  : void
Normalizes class names following the rules of identifier-normalization
setValue()  : void
withColumnWidth()  : TableNode
withKeepExistingOptions()  : static
Adds $options as default options without overriding any options already set.
withOptions()  : static
columnsOf()  : TableColumn[]
replaceColumn()  : TableRow[]

Properties

$columnWidth

protected array $columnWidth = []

$options

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

Methods

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

getCols()

public getCols() : int
Return values
int

getColumnWidth()

public getColumnWidth() : int[]
Return values
int[]

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>

getRows()

public getRows() : int
Return values
int

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()

A table keeps its shape: a removed cell becomes an empty cell of the same size.

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

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