Column class for Zend_Text_Table_Row

category Zend
package Zend_Text_Table
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Create a column for a Zend_Text_Table_Row object.

__construct(string $content = null, string $align = null, integer $colSpan = null, string $charset = null

Parameters

$content

string

The content of the column

$align

string

The align of the content

$colSpan

integer

The colspan of the column

$charset

string

The encoding of the content

Get the colspan

getColSpan() : integer

Returns

integer

Render the column width the given column width

render(integer $columnWidth, integer $padding = 0) : string

Parameters

$columnWidth

integer

The width of the column

$padding

integer

The padding for the column

Exceptions

\Zend_Text_Table_Exception When $columnWidth is lower than 1
\Zend_Text_Table_Exception When padding is greater than columnWidth

Returns

string

Set the align

setAlign(string $align) : \Zend_Text_Table_Column

Parameters

$align

string

Align of the column

Exceptions

\Zend_Text_Table_Exception When supplied align is invalid

Returns

\Zend_Text_Table_Column

Set the colspan

setColSpan(integer $colSpan) : \Zend_Text_Table_Column

Parameters

$colSpan

integer

Exceptions

\Zend_Text_Table_Exception When $colSpan is smaller than 1

Returns

\Zend_Text_Table_Column

Set the content.

setContent(string $content, string $charset = null) : \Zend_Text_Table_Column

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

$content

string

Content of the column

$charset

string

The charset of the content

Exceptions

\Zend_Text_Table_Exception When $content is not a string

Returns

\Zend_Text_Table_Column

 Properties

 

Align of the column

$_align : string

Default

self::ALIGN_LEFT
 

Allowed align parameters

$_allowedAligns : array

Default

array(self::ALIGN_LEFT, self::ALIGN_CENTER, self::ALIGN_RIGHT)
 

Colspan of the column

$_colSpan : integer

Default

1
 

Content of the column

$_content : string

Default

''

 Constants

 

ALIGN_CENTER

ALIGN_CENTER = 'center' 
 

Aligns for columns

ALIGN_LEFT = 'left' 
 

ALIGN_RIGHT

ALIGN_RIGHT = 'right'