Column

Column

Column

Methods

Inherited from BasicAttributesTrait

__construct

Column::__construct( $id, $label = '' )

getLabel

Gets the column label, often displayed in the table heading.

Column::getLabel( ): string

Return Value: string


width

Sets the column width.

Column::width( string|integer $width ): self

Returns Self: This method can be chained.


getWidth

Gets the column width.

Column::getWidth( ): string|integer

Return Value: string|integer


description

Sets the column description, often displayed as smaller text below the label.

Column::description( string $description ): self

Returns Self: This method can be chained.


getDescription

Gets the column description, often displayed as smaller text below the label.

Column::getDescription( ): string

Return Value: string


sortable

Sets the names of table columns to sort on. Blank defaults to the column name, false disables sorting.

Column::sortable( array|boolean $value = null ): self

Returns Self: This method can be chained.


notSortable

Disables sorting for this column.

Column::notSortable( ): self

Returns Self: This method can be chained.


getSortable

Gets the name of table columns to sort on, or false if sorting is disabled.

Column::getSortable( ): array|boolean

Return Value: array|boolean


format

Sets the formatter as a callable, which should accept a $data param of row data.

Column::format( callable $formatter ): self

Returns Self: This method can be chained.


hasFormatter

Does the column have a valid formatter?

Column::hasFormatter( ): boolean

Return Value: boolean


modifyCells

Set a callable function that can modify each cell and/or row based on that row’s data.

Column::modifyCells( callable $callable ): self

Returns Self: This method can be chained.


getCellModifiers

Get the array of column logic callables.

Column::getCellModifiers( ): callable

Return Value: callable


getOutput

Renders the column by either passing the row $data to a formatter, or grabbing the row data by key based on the column name.

Column::getOutput( array &$data = array() ): string

Return Value: string