Text/Table/Column.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_Column

Package: Zend_Text_Table
Column class for Zend_Text_Table_Row
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  ALIGN_LEFT = 'left'
Aligns for columns
>VConstant  ALIGN_CENTER = 'center'
>VConstant  ALIGN_RIGHT = 'right'

Properties

>VPropertyprotectedstring $_align = self::ALIGN_LEFT
Align of the column
Default valueself::ALIGN_LEFTDetails
Type
string
>VPropertyprotectedarray $_allowedAligns = array(self::ALIGN_LEFT, self::ALIGN_CENTER, self::ALIGN_RIGHT)
Allowed align parameters
Default valuearray(self::ALIGN_LEFT, self::ALIGN_CENTER, self::ALIGN_RIGHT)Details
Type
array
>VPropertyprotectedinteger $_colSpan = 1
Colspan of the column
Default value1Details
Type
integer
>VPropertyprotectedstring $_content = ''
Content of the column
Default value''Details
Type
string

Methods

methodpublic__construct(string $content = null, string $align = null, integer $colSpan = null, string $charset = null) : void

Create a column for a Zend_Text_Table_Row object.

Parameters
NameTypeDescription
$contentstring

The content of the column

$alignstring

The align of the content

$colSpaninteger

The colspan of the column

$charsetstring

The encoding of the content

methodpublicgetColSpan() : integer

Get the colspan

Returns
TypeDescription
integer
methodpublicrender(integer $columnWidth, integer $padding = 0) : string

Render the column width the given column width

Parameters
NameTypeDescription
$columnWidthinteger

The width of the column

$paddinginteger

The padding for the column

Returns
TypeDescription
string
Throws
ExceptionDescription
\Zend_Text_Table_ExceptionWhen $columnWidth is lower than 1
\Zend_Text_Table_ExceptionWhen padding is greater than columnWidth
methodpublicsetAlign(string $align) : \Zend_Text_Table_Column

Set the align

Parameters
NameTypeDescription
$alignstring

Align of the column

Returns
TypeDescription
\Zend_Text_Table_Column
Throws
ExceptionDescription
\Zend_Text_Table_ExceptionWhen supplied align is invalid
methodpublicsetColSpan(int $colSpan) : \Zend_Text_Table_Column

Set the colspan

Parameters
NameTypeDescription
$colSpanint
Returns
TypeDescription
\Zend_Text_Table_Column
Throws
ExceptionDescription
\Zend_Text_Table_ExceptionWhen $colSpan is smaller than 1
methodpublicsetContent(string $content, string $charset = null) : \Zend_Text_Table_Column

Set the content.

If $charset is not defined, it is assumed that $content is encoded in the charset defined via Zend_Text_Table::setInputCharset() (defaults to utf-8).
Parameters
NameTypeDescription
$contentstring

Content of the column

$charsetstring

The charset of the content

Returns
TypeDescription
\Zend_Text_Table_Column
Throws
ExceptionDescription
\Zend_Text_Table_ExceptionWhen $content is not a string
Documentation was generated by phpDocumentor 2.2.0 .