Simple table view. More...
Public Member Functions | |
__construct () | |
Constructor. | |
addColumn ($type, $opts) | |
Add column to table. More... | |
columns () | |
Get columns added by addColumn(). More... | |
addAction ($name, $opts) | |
Add action button. | |
getActions () | |
Get all actions added with addAction(). | |
setTableClass ($class) | |
Set class attribute of the table. | |
getTableClass () | |
Get class attribute of the table. | |
setRowClass ($class) | |
Set class attribute of each row. | |
getRowClass () | |
Get class attribute of each row. | |
setDataIteratorFunction ($iterator_object, $iterator_func) | |
Set iterator object as data source. More... | |
setData ($data) | |
Set array as data source. More... | |
getNextRowData () | |
Get next row from data source (used by template). | |
Public Attributes | |
$show_header = true | |
Show table header? | |
$show_footer = false | |
Show table footer? | |
$row_data | |
Callable which returns array of data attributes of <tr> tag. More... | |
Simple table view.
Renders list of items into predefined table.
addColumn | ( | $type, | |
$opts | |||
) |
Add column to table.
$type sets template used to render the column, $opts are passed to the template.
columns | ( | ) |
Get columns added by addColumn().
/
getColumns
. setDataIteratorFunction | ( | $iterator_object, | |
$iterator_func | |||
) |
Set iterator object as data source.
To retrieve next row the $iterator_object->$iterator_func()
is called.
setData | ( | $data | ) |
Set array as data source.
One item in array is one row in table.
$row_data |
Callable which returns array of data attributes of <tr>
tag.
Returns array($k => $v)
, which will be added to <tr>
element as data-$k="$v"
.