static fromArray(
array
$headers ,
array
$data ,
boolean
$returnObject = false ] )
|
|
Converts an array to a table. Must be a two dimensional array.
Parámetros:
array |
$headers: |
|
array |
$data: |
|
boolean |
$returnObject: |
|
Applies any column filters to the data
_calculateCellLengths(
array
$row )
|
|
This function given a row of data will
calculate the max length for each column
and store it in the _cell_lengths array.
Parámetros:
Calculates totals for columns
Returns header line for the table
Creates a horizontal separator for header
separation and table start/end etc
_updateRowsCols(
[
$rowdata = null ] )
|
|
Update max cols/rows
Parámetros:
Ensures column and row counts are correct
addCol(
array
$col_data ,
integer
$col_id ,
integer
$row_id )
|
|
Adds a column to the table
Parámetros:
array |
$col_data: |
|
integer |
$col_id: |
|
integer |
$row_id: |
|
addData(
array
$data ,
integer
$col_id ,
integer
$row_id )
|
|
Adds data to the table. Argument should be
a two dimensional array containing the data
to be added.
Parámetros:
array |
$data: |
|
integer |
$col_id: |
|
integer |
$row_id: |
|
addFilter(
integer
$col ,
callback
$callback )
|
|
Adds a filter to the object. Filters are standard php callbacks which are
run on the data before table generation is performed. Filters are applied
in the order they're added. the callback function must accept a single
argument, which is a single table cell.
Parámetros:
integer |
$col: |
|
callback |
$callback: |
|
addRow(
array
$row ,
[array
$append = true ] )
|
|
Adds a row to the table
Parámetros:
array |
$row: |
|
array |
$append: |
|
Adds a Horizontal Seperator to the table
calculateTotalsFor(
array
$cols )
|
|
Specifies which columns are to have totals calculated for them and
added as a new row at the bottom.
Parámetros:
Console_Table(
[integer
$align = CONSOLE_TABLE_ALIGN_LEFT ] )
|
|
Constructor
Parámetros:
Returns the table in wonderful
ASCII art
insertRow(
array
$row ,
integer
$row_id )
|
|
Inserts a row after a given row number in the table. If $row_id
is not given it will prepend the row.
Parámetros:
array |
$row: |
|
integer |
$row_id: |
|
setAlign(
integer
$col_id ,
[integer
$align = CONSOLE_TABLE_ALIGN_LEFT ] )
|
|
Sets the alignment for the columns
Parámetros:
integer |
$col_id: |
|
integer |
$align: |
|
setHeaders(
array
$headers )
|
|
Sets the headers for the columns
Parámetros: