Text/Table.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Text_Table
- Version
- $Id$
\Zend_Text_Table
Package: Zend_Text_Table

















Zend_Text_Table enables developers to create tables out of characters
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties

integer $_autoSeparate = self::AUTO_SEPARATE_ALLAuto separation mode
Default value
self::AUTO_SEPARATE_ALLDetails- Type
- integer

\Zend_Text_Table_Decorator_Interface $_decorator = nullDecorator used for the table borders
Default value
nullDetails
array $_defaultColumnAligns = array()Default column aligns for rows created by appendRow(array $data)
Default value
array()Details- Type
- array

string $_inputCharset = 'utf-8'static
Charset which is used for input by default
Default value
'utf-8'Details- Type
- string

string $_outputCharset = 'utf-8'static
Charset which is used internally
Default value
'utf-8'Details- Type
- string
Methods

__construct(\Zend_Config | array $options = null) : voidCreate a basic table object
Parameters
Throws
| Name | Type | Description |
|---|---|---|
| $options | \Zend_Config | array | Configuration options |
| Exception | Description |
|---|---|
| \Zend_Text_Table_Exception | When no columns widths were set |

appendRow(array | \Zend_Text_Table_Row $row) : \Zend_Text_TableAppend a row to the table
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $row | array | \Zend_Text_Table_Row | The row to append to the table |
| Type | Description |
|---|---|
| \Zend_Text_Table |
| Exception | Description |
|---|---|
| \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 |

getPluginLoader() : \Zend_Loader_PluginLoaderGet the plugin loader for decorators
Returns
| Type | Description |
|---|---|
| \Zend_Loader_PluginLoader |

render() : stringRender the table
Returns
Throws
| Type | Description |
|---|---|
| string |
| Exception | Description |
|---|---|
| \Zend_Text_Table_Exception | When no rows were added to the table |

setAutoSeparate(integer $autoSeparate) : \Zend_Text_TableSet auto separation mode
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $autoSeparate | integer | Auto separation mode |
| Type | Description |
|---|---|
| \Zend_Text_Table |

setColumnWidths(array $columnWidths) : \Zend_Text_TableSet column widths
Parameters
Returns
Throws
| Name | Type | Description |
|---|---|---|
| $columnWidths | array | Widths of all columns |
| Type | Description |
|---|---|
| \Zend_Text_Table |
| Exception | Description |
|---|---|
| \Zend_Text_Table_Exception | When no columns were supplied |
| \Zend_Text_Table_Exception | When a column has an invalid width |

setConfig(\Zend_Config $config) : \Zend_Text_TableSet options from config object
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $config | \Zend_Config | Configuration for Zend_Text_Table |
| Type | Description |
|---|---|
| \Zend_Text_Table |

setDecorator(\Zend_Text_Table_Decorator_Interface | string $decorator) : \Zend_Text_TableSet decorator
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $decorator | \Zend_Text_Table_Decorator_Interface | string | Decorator to use |
| Type | Description |
|---|---|
| \Zend_Text_Table |

setDefaultColumnAlign(integer $columnNum, string $align) : \Zend_Text_TableSet default column align for rows created by appendRow(array $data)
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $columnNum | integer | |
| $align | string |
| Type | Description |
|---|---|
| \Zend_Text_Table |

setInputCharset(string $charset) : voidstatic
Set the input charset for column contents
Parameters
| Name | Type | Description |
|---|---|---|
| $charset | string |

setOptions(array $options) : \Zend_Text_TableSet options from array
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $options | array | Configuration for Zend_Text_Table |
| Type | Description |
|---|---|
| \Zend_Text_Table |

setOutputCharset(string $charset) : voidstatic
Set the output charset for column contents
Parameters
| Name | Type | Description |
|---|---|---|
| $charset | string |

setPadding(integer $padding) : \Zend_Text_TableSet the column padding
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $padding | integer | The padding for the columns |
| Type | Description |
|---|---|
| \Zend_Text_Table |