PHP Класс 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=
Наследование: extends View
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
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 )

Описание методов

defaultTemplate() публичный Метод

Sets default template.
public defaultTemplate ( ) : array
Результат array

formatRow() публичный Метод

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() публичный Метод

Returns data source iterator.
public getIterator ( ) : mixed
Результат mixed

offsetExists() публичный Метод

{{{ ArrayAccess support
public offsetExists ( $name )

offsetGet() публичный Метод

public offsetGet ( $name )

offsetSet() публичный Метод

public offsetSet ( $name, $val )

offsetUnset() публичный Метод

public offsetUnset ( $name )

render() публичный Метод

Renders everything.
public render ( )

rowRender() публичный Метод

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
Результат string HTML of rendered template

setSource() публичный Метод

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 setStaticSource ( $data )

Описание свойств

$current публичное свойство

Points to the current record returned by iterator. Can be array or object.
public array|object $current
Результат array | object

$current_id публичное свойство

Contains ID of current record.
public mixed $current_id
Результат mixed

$current_row публичное свойство

Points to hash for current row before it's being outputted. Used in formatRow().
public array $current_row
Результат array

$current_row_html публичное свойство

Similar to $current_row, but will be used for direct HTML output, no escaping. Use with care.
public array $current_row_html
Результат array

$dq публичное свойство

If lister data is retrieved from the SQL database, this will contain dynamic query.
public DB_dsql $dq
Результат DB_dsql

$iter публичное свойство

For other iterators, this variable will be used.
public mixed $iter
Результат mixed