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 [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Text_Table
- Version
- $Id: Table.php 25024 2012-07-30 15:08:15Z rob $
\Zend_Text_Table
Zend_Text_Table enables developers to create tables out of characters
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties

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

\Zend_Text_Table_Decorator_Interface $_decorator = nullDecorator used for the table borders
nullDetails

array $_defaultColumnAligns = array()Default column aligns for rows created by appendRow(array $data)
array()Details- Type
- array

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

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

__construct(\Zend_Config | array $options = null) : voidCreate a basic table object
| 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
| 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
| Type | Description |
|---|---|
| \Zend_Loader_PluginLoader |

render() : stringRender the table
| 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
| Name | Type | Description |
|---|---|---|
| $autoSeparate | integer | Auto separation mode |
| Type | Description |
|---|---|
| \Zend_Text_Table |

setColumnWidths(array $columnWidths) : \Zend_Text_TableSet column widths
| 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
| 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
| 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)
| Name | Type | Description |
|---|---|---|
| $columnNum | integer | |
| $align | string |
| Type | Description |
|---|---|
| \Zend_Text_Table |

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

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

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

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