Zend_Text_Table enables developers to create tables out of characters

category Zend
package Zend_Text_Table
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Create a basic table object

__construct(\Zend_Config|array $options = null

Parameters

$options

\Zend_Configarray

Configuration options

Exceptions

\Zend_Text_Table_Exception When no columns widths were set

Magic method which returns the rendered table

__toString() : string

Returns

string

Append a row to the table

appendRow(array|\Zend_Text_Table_Row $row) : \Zend_Text_Table

Parameters

$row

array\Zend_Text_Table_Row

The row to append to the table

Exceptions

\Zend_Text_Table_Exception When $row is neither an array nor Zend_Zext_Table_Row
\Zend_Text_Table_Exception When a row contains too many columns

Returns

\Zend_Text_Table

Get the input charset for column contents

getInputCharset() 
Static

Get the output charset for column contents

getOutputCharset() 
Static

Get the plugin loader for decorators

getPluginLoader() : \Zend_Loader_PluginLoader

Returns

\Zend_Loader_PluginLoader

Render the table

render() : string

Exceptions

\Zend_Text_Table_Exception When no rows were added to the table

Returns

string

Set auto separation mode

setAutoSeparate(integer $autoSeparate) : \Zend_Text_Table

Parameters

$autoSeparate

integer

Auto separation mode

Returns

\Zend_Text_Table

Set column widths

setColumnWidths(array $columnWidths) : \Zend_Text_Table

Parameters

$columnWidths

array

Widths of all columns

Exceptions

\Zend_Text_Table_Exception When no columns were supplied
\Zend_Text_Table_Exception When a column has an invalid width

Returns

\Zend_Text_Table

Set options from config object

setConfig(\Zend_Config $config) : \Zend_Text_Table

Parameters

$config

\Zend_Config

Configuration for Zend_Text_Table

Returns

\Zend_Text_Table

Set decorator

setDecorator(\Zend_Text_Table_Decorator_Interface|string $decorator) : \Zend_Text_Table

Parameters

$decorator

\Zend_Text_Table_Decorator_Interfacestring

Decorator to use

Returns

\Zend_Text_Table

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

setDefaultColumnAlign(integer $columnNum, string $align) : \Zend_Text_Table

Parameters

$columnNum

integer

$align

string

Returns

\Zend_Text_Table

Set the input charset for column contents

setInputCharset(string $charset) 
Static

Parameters

$charset

string

Set options from array

setOptions(array $options) : \Zend_Text_Table

Parameters

$options

array

Configuration for Zend_Text_Table

Returns

\Zend_Text_Table

Set the output charset for column contents

setOutputCharset(string $charset) 
Static

Parameters

$charset

string

Set the column padding

setPadding(integer $padding) : \Zend_Text_Table

Parameters

$padding

integer

The padding for the columns

Returns

\Zend_Text_Table

 Properties

 

Auto separation mode

$_autoSeparate : integer

Default

self::AUTO_SEPARATE_ALL
 

List of all column widths

$_columnWidths : array

Default

null
 

Decorator used for the table borders

$_decorator : \Zend_Text_Table_Decorator_Interface

Default

null
 

Default column aligns for rows created by appendRow(array $data)

$_defaultColumnAligns : array

Default

array()
 

Charset which is used for input by default

$_inputCharset : string

Default

'utf-8'
Static
 

Charset which is used internally

$_outputCharset : string

Default

'utf-8'
Static
 

Padding for columns

$_padding : integer

Default

0
 

Plugin loader for decorators

$_pluginLoader : string

Default

null
 

Rows of the table

$_rows : array

Default

array()
 

Option keys to skip when calling setOptions()

$_skipOptions : array

Default

array('options', 'config', 'defaultColumnAlign')

 Constants

 

AUTO_SEPARATE_ALL

AUTO_SEPARATE_ALL = 4 
   

AUTO_SEPARATE_HEADER

AUTO_SEPARATE_HEADER = 1 
 

Auto seperator settings

AUTO_SEPARATE_NONE = 0