Centrales |  Componentes |  consola |  Debug |  Default |  Fuentes |  SalidaGrafica |  Seguridad |  SIUToba |  Varios |  Deprecated

Console_Table

Console_Table

Ubicada en php/consola/lib/Table.php [line 49]



Métodos Propios
static void   fromArray()   (Static)
void   _applyFilters ()  
void   _buildTable ()  
void   _calculateCellLengths ()  
void   _calculateTotals ()  
void   _getHeaderLine ()  
void   _getSeparator ()  
void   _updateRowsCols ()  
void   _validateTable ()  
void   addCol ()  
void   addData ()  
void   addFilter ()  
void   addRow ()  
void   addSeparator ()  
void   calculateTotalsFor ()  
void   Console_Table ()  
void   getTable ()  
void   insertRow ()  
void   setAlign ()  
void   setHeaders ()  

static method fromArray  [línea 157]

  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: 





_applyFilters   [línea 360]

  _applyFilters( )

Applies any column filters to the data





_buildTable   [línea 403]

  _buildTable( )

Builds the table





_calculateCellLengths   [línea 521]

  _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:
array   $row: 





_calculateTotals   [línea 335]

  _calculateTotals( )

Calculates totals for columns





_getHeaderLine   [línea 460]

  _getHeaderLine( )

Returns header line for the table





_getSeparator   [línea 441]

  _getSeparator( )

Creates a horizontal separator for header separation and table start/end etc





_updateRowsCols   [línea 489]

  _updateRowsCols( [ $rowdata = null ] )

Update max cols/rows
Parámetros:
   $rowdata: 





_validateTable   [línea 378]

  _validateTable( )

Ensures column and row counts are correct





addCol   [línea 275]

  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   [línea 295]

  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   [línea 183]

  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   [línea 245]

  addRow( array $row , [array $append = true ] )

Adds a row to the table
Parámetros:
array   $row: 
array   $append: 





addSeparator   [línea 312]

  addSeparator( )

Adds a Horizontal Seperator to the table





calculateTotalsFor   [línea 221]

  calculateTotalsFor( array $cols )

Specifies which columns are to have totals calculated for them and added as a new row at the bottom.
Parámetros:
array   $cols: 





Console_Table   [línea 135]

  Console_Table( [integer $align = CONSOLE_TABLE_ALIGN_LEFT ] )

Constructor
Parámetros:
integer   $align: 





getTable   [línea 322]

  getTable( )

Returns the table in wonderful ASCII art





insertRow   [línea 260]

  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   [línea 199]

  setAlign( integer $col_id , [integer $align = CONSOLE_TABLE_ALIGN_LEFT ] )

Sets the alignment for the columns
Parámetros:
integer   $col_id: 
integer   $align: 





setHeaders   [línea 232]

  setHeaders( array $headers )

Sets the headers for the columns
Parámetros:
array   $headers: 






Desarrollado por SIU.
Documentación generada con phpDocumentor