Axiom (v1.2.0)

A lightweight PHP framework
axTableRowGroupHelper Class Reference

Table Row Group Helper Class. More...

+ Inheritance diagram for axTableRowGroupHelper:

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.

Detailed Description

Table Row Group Helper Class.

Author:
Delespierre
License:
http://www.gnu.org/licenses/lgpl.html Lesser General Public Licence version 3

Definition at line 16 of file axTableRowGroupHelper.class.php.


Constructor & Destructor Documentation

Constructor.

The $type parameter can be either

  • head or thead
  • foot or tfoot
  • body or tbody
Parameters:
string$type

Definition at line 77 of file axTableRowGroupHelper.class.php.


Member Function Documentation

__toString implementation

Get a string represenation of current node and its children.

Returns:
string

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.

Parameters:
Traversable | array$values
string$cell_type[optional] [default "auto"]
Returns:
TableGroupHelper

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.

See also:
axTableRowGroupHelper::addRow()
Parameters:
Traversable | array$rows
string$cell_type[optional] [default "auto"]
Returns:
TableGroupHelper

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.

See also:
axTableRowGroupHelper::before()
Parameters:
mixed$content
callback$replace_callback[optional] [default null]
Returns:
axTableRowGroupHelper

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"]); }');
Parameters:
mixed$content
callback$replace_callback[optional] [default null]
Returns:
axTableRowGroupHelper

Definition at line 185 of file axTableRowGroupHelper.class.php.

static axTableRowGroupHelper::export ( type) [static]

Constructor static alias.

Constructor.

The $type parameter can be either

  • head or thead
  • foot or tfoot
  • body or tbody
Parameters:
string$type
Returns:
axTableRowGroupHelper

Definition at line 326 of file axTableRowGroupHelper.class.php.

Get any defined column callback.

Parameters:
string$key

Definition at line 129 of file axTableRowGroupHelper.class.php.

Filter getter.

Returns:
array

Definition at line 111 of file axTableRowGroupHelper.class.php.

Type getter.

Returns:
string

Definition at line 103 of file axTableRowGroupHelper.class.php.

axTableRowGroupHelper::setColumnCallback ( key,
callback 
)

Set a column display transformation callback.

Parameters:
string$key
callback$callback
Returns:
TableGroupHelper

Definition at line 140 of file axTableRowGroupHelper.class.php.

Set multiple callbacks at once.

Parameters:
array$callbacks
Returns:
TableGroupHelper

Definition at line 156 of file axTableRowGroupHelper.class.php.

axTableRowGroupHelper::setFilter ( array $  filter)

Filter setter.

Parameters:
array$filter
Returns:
axTableRowGroupHelper

Definition at line 120 of file axTableRowGroupHelper.class.php.


Field Documentation

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]

Type.

Can be either:

  • head
  • foot
  • body

Definition at line 28 of file axTableRowGroupHelper.class.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables