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-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_ALL
Auto separation mode
Default value
self::AUTO_SEPARATE_ALL
Details- Type
- integer
\Zend_Text_Table_Decorator_Interface $_decorator = null
Decorator used for the table borders
Default value
null
Detailsarray $_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) : void
Create 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_Table
Append 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_PluginLoader
Get the plugin loader for decorators
Returns
Type | Description |
---|---|
\Zend_Loader_PluginLoader |
render() : string
Render 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_Table
Set auto separation mode
Parameters
Returns
Name | Type | Description |
---|---|---|
$autoSeparate | integer | Auto separation mode |
Type | Description |
---|---|
\Zend_Text_Table |
setColumnWidths(array $columnWidths) : \Zend_Text_Table
Set 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_Table
Set 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_Table
Set 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_Table
Set 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) : void
static
Set the input charset for column contents
Parameters
Name | Type | Description |
---|---|---|
$charset | string |
setOptions(array $options) : \Zend_Text_Table
Set options from array
Parameters
Returns
Name | Type | Description |
---|---|---|
$options | array | Configuration for Zend_Text_Table |
Type | Description |
---|---|
\Zend_Text_Table |
setOutputCharset(string $charset) : void
static
Set the output charset for column contents
Parameters
Name | Type | Description |
---|---|---|
$charset | string |
setPadding(integer $padding) : \Zend_Text_Table
Set the column padding
Parameters
Returns
Name | Type | Description |
---|---|---|
$padding | integer | The padding for the columns |
Type | Description |
---|---|
\Zend_Text_Table |