PHP Class Lister, atk4

(c) 2008-2013 Agile Toolkit Limited Distributed under Affero General Public License v3 and commercial license. See LICENSE or LICENSE_COM for more information =====================================================ATK4=
Inheritance: extends View
Exibir arquivo Open project: atk4/atk4 Class Usage Examples

Public Properties

Property Type Description
$current array | object Points to the current record returned by iterator. Can be array or object.
$current_id mixed Contains ID of current record.
$current_row array Points to hash for current row before it's being outputted. Used in formatRow().
$current_row_html array Similar to $current_row, but will be used for direct HTML output, no escaping. Use with care.
$dq DB_dsql If lister data is retrieved from the SQL database, this will contain dynamic query.
$iter mixed For other iterators, this variable will be used.

Public Methods

Method Description
defaultTemplate ( ) : array Sets default template.
formatRow ( ) Called after iterating and may be redefined to change contents of :php:attr:Lister::current_row. Redefine this method to change rendering logic.
getIterator ( ) : mixed Returns data source iterator.
offsetExists ( $name ) {{{ ArrayAccess support
offsetGet ( $name )
offsetSet ( $name, $val )
offsetUnset ( $name )
render ( ) Renders everything.
rowRender ( Template $template ) : string Renders single row.
setSource ( mixed $source, array | string | null $fields = null ) Similar to setModel, however you specify array of data here. setSource is actually implemented around :php:class:Controller_Data_Array. actually you can pass anything iterateable to setSource() as long as elements of iterating produce either a string or array.
setStaticSource ( $data )

Method Details

defaultTemplate() public method

Sets default template.
public defaultTemplate ( ) : array
return array

formatRow() public method

Called after iterating and may be redefined to change contents of :php:attr:Lister::current_row. Redefine this method to change rendering logic.
public formatRow ( )

getIterator() public method

Returns data source iterator.
public getIterator ( ) : mixed
return mixed

offsetExists() public method

{{{ ArrayAccess support
public offsetExists ( $name )

offsetGet() public method

public offsetGet ( $name )

offsetSet() public method

public offsetSet ( $name, $val )

offsetUnset() public method

public offsetUnset ( $name )

render() public method

Renders everything.
public render ( )

rowRender() public method

If you use for formatting then interact with template->set() directly prior to calling parent
public rowRender ( Template $template ) : string
$template Template template to use for row rendering
return string HTML of rendered template

setSource() public method

Similar to setModel, however you specify array of data here. setSource is actually implemented around :php:class:Controller_Data_Array. actually you can pass anything iterateable to setSource() as long as elements of iterating produce either a string or array.
public setSource ( mixed $source, array | string | null $fields = null )
$source mixed
$fields array | string | null

setStaticSource() public method

public setStaticSource ( $data )

Property Details

$current public_oe property

Points to the current record returned by iterator. Can be array or object.
public array|object $current
return array | object

$current_id public_oe property

Contains ID of current record.
public mixed $current_id
return mixed

$current_row public_oe property

Points to hash for current row before it's being outputted. Used in formatRow().
public array $current_row
return array

$current_row_html public_oe property

Similar to $current_row, but will be used for direct HTML output, no escaping. Use with care.
public array $current_row_html
return array

$dq public_oe property

If lister data is retrieved from the SQL database, this will contain dynamic query.
public DB_dsql $dq
return DB_dsql

$iter public_oe property

For other iterators, this variable will be used.
public mixed $iter
return mixed