Text/Table.php

Show: PublicProtectedPrivateinherited
Table of Contents
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

>VConstant  AUTO_SEPARATE_NONE = 0
Auto seperator settings
>VConstant  AUTO_SEPARATE_HEADER = 1
>VConstant  AUTO_SEPARATE_FOOTER = 2
>VConstant  AUTO_SEPARATE_ALL = 4

Properties

>VPropertyprotectedinteger $_autoSeparate = self::AUTO_SEPARATE_ALL
Auto separation mode
Default valueself::AUTO_SEPARATE_ALLDetails
Type
integer
>VPropertyprotectedarray $_columnWidths = null
List of all column widths
Default valuenullDetails
Type
array
>VPropertyprotected\Zend_Text_Table_Decorator_Interface $_decorator = null
Decorator used for the table borders
Default valuenullDetails
Type
\Zend_Text_Table_Decorator_Interface
>VPropertyprotectedarray $_defaultColumnAligns = array()
Default column aligns for rows created by appendRow(array $data)
Default valuearray()Details
Type
array
>VPropertyprotectedstring $_inputCharset = 'utf-8'
static
Charset which is used for input by default
Default value'utf-8'Details
Type
string
>VPropertyprotectedstring $_outputCharset = 'utf-8'
static
Charset which is used internally
Default value'utf-8'Details
Type
string
>VPropertyprotectedinteger $_padding = 0
Padding for columns
Default value0Details
Type
integer
>VPropertyprotectedstring $_pluginLoader = null
Plugin loader for decorators
Default valuenullDetails
Type
string
>VPropertyprotectedarray $_rows = array()
Rows of the table
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_skipOptions = array('options', 'config', 'defaultColumnAlign')
Option keys to skip when calling setOptions()
Default valuearray('options', 'config', 'defaultColumnAlign')Details
Type
array

Methods

methodpublic__construct(\Zend_Config | array $options = null) : void

Create a basic table object

Parameters
NameTypeDescription
$options\Zend_Config | array

Configuration options

Throws
ExceptionDescription
\Zend_Text_Table_ExceptionWhen no columns widths were set
methodpublic__toString() : string

Magic method which returns the rendered table

Returns
TypeDescription
string
methodpublicappendRow(array | \Zend_Text_Table_Row $row) : \Zend_Text_Table

Append a row to the table

Parameters
NameTypeDescription
$rowarray | \Zend_Text_Table_Row

The row to append to the table

Returns
TypeDescription
\Zend_Text_Table
Throws
ExceptionDescription
\Zend_Text_Table_ExceptionWhen $row is neither an array nor Zend_Zext_Table_Row
\Zend_Text_Table_ExceptionWhen a row contains too many columns
methodpublicgetInputCharset() : void
static

Get the input charset for column contents

methodpublicgetOutputCharset() : void
static

Get the output charset for column contents

methodpublicgetPluginLoader() : \Zend_Loader_PluginLoader

Get the plugin loader for decorators

Returns
TypeDescription
\Zend_Loader_PluginLoader
methodpublicrender() : string

Render the table

Returns
TypeDescription
string
Throws
ExceptionDescription
\Zend_Text_Table_ExceptionWhen no rows were added to the table
methodpublicsetAutoSeparate(integer $autoSeparate) : \Zend_Text_Table

Set auto separation mode

Parameters
NameTypeDescription
$autoSeparateinteger

Auto separation mode

Returns
TypeDescription
\Zend_Text_Table
methodpublicsetColumnWidths(array $columnWidths) : \Zend_Text_Table

Set column widths

Parameters
NameTypeDescription
$columnWidthsarray

Widths of all columns

Returns
TypeDescription
\Zend_Text_Table
Throws
ExceptionDescription
\Zend_Text_Table_ExceptionWhen no columns were supplied
\Zend_Text_Table_ExceptionWhen a column has an invalid width
methodpublicsetConfig(\Zend_Config $config) : \Zend_Text_Table

Set options from config object

Parameters
NameTypeDescription
$config\Zend_Config

Configuration for Zend_Text_Table

Returns
TypeDescription
\Zend_Text_Table
methodpublicsetDecorator(\Zend_Text_Table_Decorator_Interface | string $decorator) : \Zend_Text_Table

Set decorator

Parameters
NameTypeDescription
$decorator\Zend_Text_Table_Decorator_Interface | string

Decorator to use

Returns
TypeDescription
\Zend_Text_Table
methodpublicsetDefaultColumnAlign(integer $columnNum, string $align) : \Zend_Text_Table

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

Parameters
NameTypeDescription
$columnNuminteger
$alignstring
Returns
TypeDescription
\Zend_Text_Table
methodpublicsetInputCharset(string $charset) : void
static

Set the input charset for column contents

Parameters
NameTypeDescription
$charsetstring
methodpublicsetOptions(array $options) : \Zend_Text_Table

Set options from array

Parameters
NameTypeDescription
$optionsarray

Configuration for Zend_Text_Table

Returns
TypeDescription
\Zend_Text_Table
methodpublicsetOutputCharset(string $charset) : void
static

Set the output charset for column contents

Parameters
NameTypeDescription
$charsetstring
methodpublicsetPadding(integer $padding) : \Zend_Text_Table

Set the column padding

Parameters
NameTypeDescription
$paddinginteger

The padding for the columns

Returns
TypeDescription
\Zend_Text_Table
Documentation was generated by phpDocumentor 2.2.0 .