Grid

Grid implements OutputableInterface, ValidatableInterface

Grid

Methods

Inherited from BasicAttributesTrait

__construct

Create an element that displays a collection of elements in a flexible grid,

Grid::__construct( \Gibbon\Forms\FormFactoryInterface $factory, string $id = '', $columns = 1 )

setColumns

Sets the number of columns wide to render the grid.

Grid::setColumns( integer $columns ): self

Returns Self: This method can be chained.


addCell

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

Grid::addCell( string $id = '' ): object

Return Value: object Column


getElements

Get all cells in the grid.

Grid::getElements( ): array

Return Value: array


getOutput

Get the HTML output of the element. Iterate over elements to build a grid.

Grid::getOutput( ): string

Return Value: string


addValidation

Dead-end stub for interface: grids cannot validate.

Grid::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.

Grid::getValidationOutput( ): string

Return Value: string


loadFrom

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

Grid::loadFrom( &$data ): self

Returns Self: This method can be chained.