Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Zend_Text_Table_Column Class Reference

Public Member Functions

 __construct ($content=null, $align=null, $colSpan=null, $charset=null)
 Create a column for a Zend_Text_Table_Row object.
 
 setContent ($content, $charset=null)
 Set the content.
 
 setAlign ($align)
 Set the align.
 
 setColSpan ($colSpan)
 Set the colspan.
 
 getColSpan ()
 Get the colspan.
 
 render ($columnWidth, $padding=0)
 Render the column width the given column width.
 

Public Attributes

const ALIGN_LEFT = 'left'
 Aligns for columns.
 
const ALIGN_CENTER = 'center'
 
const ALIGN_RIGHT = 'right'
 

Protected Attributes

 $_content = ''
 
 $_align = self::ALIGN_LEFT
 
 $_colSpan = 1
 
 $_allowedAligns = array(self::ALIGN_LEFT, self::ALIGN_CENTER, self::ALIGN_RIGHT)
 

Constructor & Destructor Documentation

__construct (   $content = null,
  $align = null,
  $colSpan = null,
  $charset = null 
)

Create a column for a Zend_Text_Table_Row object.

Parameters
string$contentThe content of the column
string$alignThe align of the content
integer$colSpanThe colspan of the column
string$charsetThe encoding of the content

Member Function Documentation

getColSpan ( )

Get the colspan.

Returns
integer
render (   $columnWidth,
  $padding = 0 
)

Render the column width the given column width.

Parameters
integer$columnWidthThe width of the column
integer$paddingThe padding for the column
Exceptions
Zend_Text_Table_ExceptionWhen $columnWidth is lower than 1
Zend_Text_Table_ExceptionWhen padding is greater than columnWidth
Returns
string
setAlign (   $align)

Set the align.

Parameters
string$alignAlign of the column
Exceptions
Zend_Text_Table_ExceptionWhen supplied align is invalid
Returns
Zend_Text_Table_Column
setColSpan (   $colSpan)

Set the colspan.

Parameters
int$colSpan
Exceptions
Zend_Text_Table_ExceptionWhen $colSpan is smaller than 1
Returns
Zend_Text_Table_Column
setContent (   $content,
  $charset = null 
)

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
string$contentContent of the column
string$charsetThe charset of the content
Exceptions
Zend_Text_Table_ExceptionWhen $content is not a string
Returns
Zend_Text_Table_Column

Member Data Documentation

$_align = self::ALIGN_LEFT
protected
$_allowedAligns = array(self::ALIGN_LEFT, self::ALIGN_CENTER, self::ALIGN_RIGHT)
protected
$_colSpan = 1
protected
$_content = ''
protected
const ALIGN_CENTER = 'center'
const ALIGN_LEFT = 'left'

Aligns for columns.

const ALIGN_RIGHT = 'right'