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
Afficher le fichier Open project: atk4/atk4 Class Usage Examples

Méthodes publiques

Свойство 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.

Méthodes publiques

Méthode 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 méthode

Sets default template.
public defaultTemplate ( ) : array
Résultat array

formatRow() public méthode

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 méthode

Returns data source iterator.
public getIterator ( ) : mixed
Résultat mixed

offsetExists() public méthode

{{{ ArrayAccess support
public offsetExists ( $name )

offsetGet() public méthode

public offsetGet ( $name )

offsetSet() public méthode

public offsetSet ( $name, $val )

offsetUnset() public méthode

public offsetUnset ( $name )

render() public méthode

Renders everything.
public render ( )

rowRender() public méthode

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
Résultat string HTML of rendered template

setSource() public méthode

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 méthode

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
Résultat array | object

$current_id public_oe property

Contains ID of current record.
public mixed $current_id
Résultat mixed

$current_row public_oe property

Points to hash for current row before it's being outputted. Used in formatRow().
public array $current_row
Résultat 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
Résultat array

$dq public_oe property

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

$iter public_oe property

For other iterators, this variable will be used.
public mixed $iter
Résultat mixed