Table Row Group Helper Class. More...
Public Member Functions | |
__construct ($type) | |
Constructor. | |
getType () | |
Type getter. | |
getFilter () | |
Filter getter. | |
setFilter (array $filter) | |
Filter setter. | |
getColumnCallback ($key) | |
Get any defined column callback. | |
setColumnCallback ($key, $callback) | |
Set a column display transformation callback. | |
setColumnCallbacks (array $callbacks) | |
Set multiple callbacks at once. | |
before ($content, $replace_callback=null) | |
Add column(s) before row content. | |
after ($content, $replace_callback=null) | |
Works exactly as axTableRowGroupHelper::before does but add new column(s) after content. | |
addRows ($rows, $cell_type="auto") | |
Add multiple rows at once. | |
addRow ($values, $cell_type="auto") | |
Add row. | |
__toString () | |
Static Public Member Functions | |
static | export ($type) |
Constructor static alias. | |
Protected Attributes | |
$_type | |
Type. | |
$_filter = array() | |
Row filter. | |
$_callbacks = array() | |
Cell display callbacks. | |
$_before_content | |
Content columns to be added before values. | |
$_before_callback | |
Content columns to be added before values replacement callback. | |
$_after_content | |
Content columns to be added after values. | |
$_after_callback | |
Content columns to be added after values callback. |
Table Row Group Helper Class.
Definition at line 16 of file axTableRowGroupHelper.class.php.
axTableRowGroupHelper::__construct | ( | $ | type | ) |
Constructor.
The $type
parameter can be either
string | $type |
Definition at line 77 of file axTableRowGroupHelper.class.php.
__toString implementation
Get a string represenation of current node and its children.
Reimplemented from axBaseHelper.
Definition at line 307 of file axTableRowGroupHelper.class.php.
axTableRowGroupHelper::addRow | ( | $ | values, |
$ | cell_type = "auto" |
||
) |
Add row.
The $cell_type parameter can be either data, head or auto.
The $cell_type
parameter can be either 'data', 'head' or 'auto'. If the $cell_type
is left to auto, it will be set to 'head' if current TableGroupHelper is header, 'data' otherwise.
Traversable | array | $values | |
string | $cell_type | [optional] [default "auto" ] |
Definition at line 257 of file axTableRowGroupHelper.class.php.
axTableRowGroupHelper::addRows | ( | $ | rows, |
$ | cell_type = "auto" |
||
) |
Add multiple rows at once.
The $cell_type
parameter can be either 'data', 'head' or 'auto'. If the $cell_type
is left to auto, it will be set to 'head' if current TableGroupHelper is header, 'data' otherwise.
Traversable | array | $rows | |
string | $cell_type | [optional] [default "auto" ] |
Definition at line 232 of file axTableRowGroupHelper.class.php.
axTableRowGroupHelper::after | ( | $ | content, |
$ | replace_callback = null |
||
) |
Works exactly as axTableRowGroupHelper::before does but add new column(s) after content.
mixed | $content | |
callback | $replace_callback | [optional] [default null ] |
Definition at line 207 of file axTableRowGroupHelper.class.php.
axTableRowGroupHelper::before | ( | $ | content, |
$ | replace_callback = null |
||
) |
Add column(s) before row content.
You may pass a callback to transform those cells and/or to change replace parameters. The callback must take as first parameter the cell(s) you are inserting (as array if multiple cells) and the rows to be inserted as second parameter. The second parameter will be provided during the array construction.
Example:
// add a message with a provided parameter before each table row $table->body->before("Id : %d", 'function ($cell, $values) { return sprintf($cell[0], $values["id"]); }');
mixed | $content | |
callback | $replace_callback | [optional] [default null ] |
Definition at line 185 of file axTableRowGroupHelper.class.php.
static axTableRowGroupHelper::export | ( | $ | type | ) | [static] |
Constructor static alias.
Constructor.
The $type
parameter can be either
string | $type |
Definition at line 326 of file axTableRowGroupHelper.class.php.
Get any defined column callback.
string | $key |
Definition at line 129 of file axTableRowGroupHelper.class.php.
axTableRowGroupHelper::setColumnCallback | ( | $ | key, |
$ | callback | ||
) |
Set a column display transformation callback.
string | $key | |
callback | $callback |
Definition at line 140 of file axTableRowGroupHelper.class.php.
axTableRowGroupHelper::setColumnCallbacks | ( | array $ | callbacks | ) |
Set multiple callbacks at once.
array | $callbacks |
Definition at line 156 of file axTableRowGroupHelper.class.php.
axTableRowGroupHelper::setFilter | ( | array $ | filter | ) |
Filter setter.
array | $filter |
Definition at line 120 of file axTableRowGroupHelper.class.php.
callback axTableRowGroupHelper::$_after_callback [protected] |
Content columns to be added after values callback.
Definition at line 65 of file axTableRowGroupHelper.class.php.
mixed axTableRowGroupHelper::$_after_content [protected] |
Content columns to be added after values.
Definition at line 59 of file axTableRowGroupHelper.class.php.
callback axTableRowGroupHelper::$_before_callback [protected] |
Content columns to be added before values replacement callback.
Definition at line 53 of file axTableRowGroupHelper.class.php.
mixed axTableRowGroupHelper::$_before_content [protected] |
Content columns to be added before values.
Definition at line 47 of file axTableRowGroupHelper.class.php.
array axTableRowGroupHelper::$_callbacks = array() [protected] |
Cell display callbacks.
Definition at line 41 of file axTableRowGroupHelper.class.php.
array axTableRowGroupHelper::$_filter = array() [protected] |
Row filter.
Definition at line 34 of file axTableRowGroupHelper.class.php.
string axTableRowGroupHelper::$_type [protected] |