Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
Zend_Text_Table Class Reference

Public Member Functions

 __construct ($options=null)
 Create a basic table object.
 
 setOptions (array $options)
 Set options from array.
 
 setConfig (Zend_Config $config)
 Set options from config object.
 
 setColumnWidths (array $columnWidths)
 Set column widths.
 
 setAutoSeparate ($autoSeparate)
 Set auto separation mode.
 
 setDecorator ($decorator)
 Set decorator.
 
 setPadding ($padding)
 Set the column padding.
 
 getPluginLoader ()
 Get the plugin loader for decorators.
 
 setDefaultColumnAlign ($columnNum, $align)
 Set default column align for rows created by appendRow(array $data)
 
 appendRow ($row)
 Append a row to the table.
 
 render ()
 Render the table.
 
 __toString ()
 Magic method which returns the rendered table.
 

Static Public Member Functions

static setInputCharset ($charset)
 Set the input charset for column contents.
 
static getInputCharset ()
 Get the input charset for column contents.
 
static setOutputCharset ($charset)
 Set the output charset for column contents.
 
static getOutputCharset ()
 Get the output charset for column contents.
 

Public Attributes

const AUTO_SEPARATE_NONE = 0x0
 Auto seperator settings.
 
const AUTO_SEPARATE_HEADER = 0x1
 
const AUTO_SEPARATE_FOOTER = 0x2
 
const AUTO_SEPARATE_ALL = 0x4
 

Protected Attributes

 $_decorator = null
 
 $_columnWidths = null
 
 $_rows = array()
 
 $_autoSeparate = self::AUTO_SEPARATE_ALL
 
 $_padding = 0
 
 $_defaultColumnAligns = array()
 
 $_pluginLoader = null
 
 $_skipOptions
 

Static Protected Attributes

static $_inputCharset = 'utf-8'
 
static $_outputCharset = 'utf-8'
 

Constructor & Destructor Documentation

__construct (   $options = null)

Create a basic table object.

Parameters
array$columnsWidthsList of all column widths
Zend_Config | array$optionsConfiguration options
Exceptions
Zend_Text_Table_ExceptionWhen no columns widths were set

Member Function Documentation

__toString ( )

Magic method which returns the rendered table.

Returns
string
appendRow (   $row)

Append a row to the table.

Parameters
array | Zend_Text_Table_Row$rowThe row to append to the table
Exceptions
Zend_Text_Table_ExceptionWhen $row is neither an array nor Zend_Zext_Table_Row
Zend_Text_Table_ExceptionWhen a row contains too many columns
Returns
Zend_Text_Table
static getInputCharset ( )
static

Get the input charset for column contents.

Parameters
string$charset
static getOutputCharset ( )
static

Get the output charset for column contents.

Parameters
string$charset
getPluginLoader ( )

Get the plugin loader for decorators.

Returns
Zend_Loader_PluginLoader
render ( )

Render the table.

Exceptions
Zend_Text_Table_ExceptionWhen no rows were added to the table
Returns
string
setAutoSeparate (   $autoSeparate)

Set auto separation mode.

Parameters
integer$autoSeparateAuto separation mode
Returns
Zend_Text_Table
setColumnWidths ( array  $columnWidths)

Set column widths.

Parameters
array$columnWidthsWidths of all columns
Exceptions
Zend_Text_Table_ExceptionWhen no columns were supplied
Zend_Text_Table_ExceptionWhen a column has an invalid width
Returns
Zend_Text_Table
setConfig ( Zend_Config  $config)

Set options from config object.

Parameters
Zend_Config$configConfiguration for Zend_Text_Table
Returns
Zend_Text_Table
setDecorator (   $decorator)

Set decorator.

Parameters
Zend_Text_Table_Decorator_Interface | string$decoratorDecorator to use
Returns
Zend_Text_Table
setDefaultColumnAlign (   $columnNum,
  $align 
)

Set default column align for rows created by appendRow(array $data)

Parameters
integer$columnNum
string$align
Returns
Zend_Text_Table
static setInputCharset (   $charset)
static

Set the input charset for column contents.

Parameters
string$charset
setOptions ( array  $options)

Set options from array.

Parameters
array$optionsConfiguration for Zend_Text_Table
Returns
Zend_Text_Table
static setOutputCharset (   $charset)
static

Set the output charset for column contents.

Parameters
string$charset
setPadding (   $padding)

Set the column padding.

Parameters
integer$paddingThe padding for the columns
Returns
Zend_Text_Table

Member Data Documentation

$_autoSeparate = self::AUTO_SEPARATE_ALL
protected
$_columnWidths = null
protected
$_decorator = null
protected
$_defaultColumnAligns = array()
protected
$_inputCharset = 'utf-8'
staticprotected
$_outputCharset = 'utf-8'
staticprotected
$_padding = 0
protected
$_pluginLoader = null
protected
$_rows = array()
protected
$_skipOptions
protected
Initial value:
= array(
'options',
'config',
'defaultColumnAlign',
)
const AUTO_SEPARATE_ALL = 0x4
const AUTO_SEPARATE_FOOTER = 0x2
const AUTO_SEPARATE_HEADER = 0x1
const AUTO_SEPARATE_NONE = 0x0

Auto seperator settings.