API Documentation

Zend/Text/Table.php

Show: inherited
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Text_Table  
Version
$Id: Table.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Text_Table

Package: 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

Constant  AUTO_SEPARATE_NONE = 0x0

Auto seperator settings

Constant  AUTO_SEPARATE_HEADER = 0x1
Constant  AUTO_SEPARATE_FOOTER = 0x2
Constant  AUTO_SEPARATE_ALL = 0x4

Properties

Propertyprotectedinteger  $_autoSeparate= 'self::AUTO_SEPARATE_ALL'

Auto separation mode

Default valueself::AUTO_SEPARATE_ALLDetails
Type
integer
Propertyprotectedarray  $_columnWidths= 'null'

List of all column widths

Default valuenullDetails
Type
array
Propertyprotected\Zend_Text_Table_Decorator_Interface  $_decorator= 'null'

Decorator used for the table borders

Default valuenullDetails
Type
\Zend_Text_Table_Decorator_Interface
Propertyprotectedarray  $_defaultColumnAligns= 'array()'

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

Default valuearray()Details
Type
array
Propertyprotectedstring  $_inputCharset= ''utf-8''
static

Charset which is used for input by default

Default value'utf-8'Details
Type
string
Propertyprotectedstring  $_outputCharset= ''utf-8''
static

Charset which is used internally

Default value'utf-8'Details
Type
string
Propertyprotectedinteger  $_padding= '0'

Padding for columns

Default value0Details
Type
integer
Propertyprotectedstring  $_pluginLoader= 'null'

Plugin loader for decorators

Default valuenullDetails
Type
string
Propertyprotectedarray  $_rows= 'array()'

Rows of the table

Default valuearray()Details
Type
array
Propertyprotectedarray  $_skipOptions= 'array( 'options''

Option keys to skip when calling setOptions()

Default valuearray( 'options'Details
Type
array

Methods

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

Create a basic table object

Parameters
Name Type Description
$options \Zend_Config|array

Configuration options

Throws
Exception Description
\Zend_Text_Table_Exception When no columns widths were set
methodpublic__toString( ) : string

Magic method which returns the rendered table

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

Append a row to the table

Parameters
Name Type Description
$row array|\Zend_Text_Table_Row

The row to append to the table

Returns
Type Description
\Zend_Text_Table
Throws
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
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
Type Description
\Zend_Loader_PluginLoader
methodpublicrender( ) : string

Render the table

Returns
Type Description
string
Throws
Exception Description
\Zend_Text_Table_Exception When no rows were added to the table
methodpublicsetAutoSeparate( integer $autoSeparate ) : \Zend_Text_Table

Set auto separation mode

Parameters
Name Type Description
$autoSeparate integer

Auto separation mode

Returns
Type Description
\Zend_Text_Table
methodpublicsetColumnWidths( array $columnWidths ) : \Zend_Text_Table

Set column widths

Parameters
Name Type Description
$columnWidths array

Widths of all columns

Returns
Type Description
\Zend_Text_Table
Throws
Exception Description
\Zend_Text_Table_Exception When no columns were supplied
\Zend_Text_Table_Exception When a column has an invalid width
methodpublicsetConfig( \Zend_Config $config ) : \Zend_Text_Table

Set options from config object

Parameters
Name Type Description
$config \Zend_Config

Configuration for Zend_Text_Table

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

Set decorator

Parameters
Name Type Description
$decorator \Zend_Text_Table_Decorator_Interface|string

Decorator to use

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

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

Parameters
Name Type Description
$columnNum integer
$align string
Returns
Type Description
\Zend_Text_Table
methodpublicsetInputCharset( string $charset ) : void
static

Set the input charset for column contents

Parameters
Name Type Description
$charset string
methodpublicsetOptions( array $options ) : \Zend_Text_Table

Set options from array

Parameters
Name Type Description
$options array

Configuration for Zend_Text_Table

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

Set the output charset for column contents

Parameters
Name Type Description
$charset string
methodpublicsetPadding( integer $padding ) : \Zend_Text_Table

Set the column padding

Parameters
Name Type Description
$padding integer

The padding for the columns

Returns
Type Description
\Zend_Text_Table
Documentation was generated by DocBlox 0.15.1.