DataTables
DataTable Class Reference

Public Member Functions

 model (string $modelName, array $columns=[])
 
 getColumns ()
 
 query ()
 
 columns (array $columns)
 
 addComponent (DataComponent $component, ? string $name=null)
 
 componentExists (string $componentName)
 
 formatHeaders (HeaderFormatter $headerFormatter)
 
 classes (string $classes)
 
 with (array $relations)
 
 noDataHtml (string $html)
 
 noDataView (string $viewName)
 
 render ()
 
 __get ($name)
 

Member Function Documentation

◆ __get()

__get (   $name)
Parameters
$name
Returns
mixed

◆ addComponent()

addComponent ( DataComponent  $component,
? string  $name = null 
)

Add a component to the data table. For example a "Paginator" or a "Sorter".

Parameters
DataComponent$component
null | string$name
Returns
DataTable
Exceptions

◆ classes()

classes ( string  $classes)

Add classes to the table.

Parameters
string$classes
Returns
$this

◆ columns()

columns ( array  $columns)

Displayed columns

Parameters
array$columns
Returns
$this

◆ componentExists()

componentExists ( string  $componentName)

Check whether a component exists for the given data table.

Parameters
string$componentName
Returns
bool

◆ formatHeaders()

formatHeaders ( HeaderFormatter  $headerFormatter)

Add a formatter for the column headers.

Parameters
HeaderFormatter$headerFormatter
Returns
DataTable

◆ getColumns()

getColumns ( )
Returns
array

◆ model()

model ( string  $modelName,
array  $columns = [] 
)

Set the base model whose data is displayed in the table.

Parameters
string$modelName
array$columns
Returns
$this
Exceptions

◆ noDataHtml()

noDataHtml ( string  $html)

Set the HTML which should be displayed when the dataset is empty.

Parameters
string$html
Returns
DataTable

◆ noDataView()

noDataView ( string  $viewName)

Set a view which should be displayed when the dataset is empty.

Parameters
string$viewName
Returns
DataTable
Exceptions

◆ query()

query ( )
Returns
Builder

◆ render()

render ( )

Renders the table.

Returns
string
Exceptions

◆ with()

with ( array  $relations)

Add a relation to the table.

Parameters
array$relations
Returns
DataTable

The documentation for this class was generated from the following file: