Table

Table implements OutputableInterface, ValidatableInterface

Column

Methods

Inherited from BasicAttributesTrait

__construct

Create an element that holds an internal collection of rows and optional header.

Table::__construct( \Gibbon\Forms\FormFactoryInterface $factory, string $id = '' )

addHeaderRow

Add a header to the internal collection and return the resulting Row object.

Table::addHeaderRow( string $id = '' ): object

Return Value: object Row


addRow

Add a row to the internal collection and return the resulting object.

Table::addRow( string $id = '' ): object

Return Value: object Row


getHeaders

Get all rows defined as headers.

Table::getHeaders( ): array

Return Value: array


getElements

Get all rows in the table.

Table::getElements( ): array

Return Value: array


getOutput

Get the HTML output of the table element. Iterate over headers and rows to build a table.

Table::getOutput( ): string

Return Value: string


addValidation

Dead-end stub for interface: columns cannot validate.

Table::addValidation( string $name ): self

Returns Self: This method can be chained.


getValidationOutput

Iterate over each element in the collection and get the combined validation output.

Table::getValidationOutput( ): string

Return Value: string


loadFrom

Pass an array of $key => $value pairs into each element in the collection.

Table::loadFrom( &$data ): self

Returns Self: This method can be chained.