PHP Класс yii\widgets\BaseListView

It provides features like sorting, paging and also filtering the data. For more details and usage information on BaseListView, see the guide article on data widgets.
С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends yii\base\Widget
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$dataProvider the data provider for the view. This property is required.
$emptyText the HTML content to be displayed when [[dataProvider]] does not have any data.
$emptyTextOptions the HTML attributes for the emptyText of the list view. The "tag" element specifies the tag name of the emptyText element and defaults to "div".
$layout the layout that determines how different sections of the list view should be organized. The following tokens will be replaced with the corresponding section contents: - {summary}: the summary section. See BaseListView::renderSummary. - {items}: the list items. See BaseListView::renderItems. - {sorter}: the sorter. See BaseListView::renderSorter. - {pager}: the pager. See BaseListView::renderPager.
$options the HTML attributes for the container tag of the list view. The "tag" element specifies the tag name of the container element and defaults to "div".
$pager the configuration for the pager widget. By default, LinkPager will be used to render the pager. You can use a different widget class by configuring the "class" element. Note that the widget must support the pagination property which will be populated with the [[\yii\data\BaseDataProvider::pagination|pagination]] value of the [[dataProvider]].
$showOnEmpty whether to show the list view if [[dataProvider]] returns no data.
$sorter the configuration for the sorter widget. By default, LinkSorter will be used to render the sorter. You can use a different widget class by configuring the "class" element. Note that the widget must support the sort property which will be populated with the [[\yii\data\BaseDataProvider::sort|sort]] value of the [[dataProvider]].
$summary the HTML content to be displayed as the summary of the list view. If you do not want to show the summary, you may set it with an empty string. The following tokens will be replaced with the corresponding values: - {begin}: the starting row number (1-based) currently being displayed - {end}: the ending row number (1-based) currently being displayed - {count}: the number of rows currently being displayed - {totalCount}: the total number of rows available - {page}: the page number (1-based) current being displayed - {pageCount}: the number of pages available
$summaryOptions the HTML attributes for the summary of the list view. The "tag" element specifies the tag name of the summary element and defaults to "div".

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

Метод Описание
init ( ) Initializes the view.
renderEmpty ( ) : string Renders the HTML content indicating that the list view has no data.
renderItems ( ) : string Renders the data models.
renderPager ( ) : string Renders the pager.
renderSection ( string $name ) : string | boolean Renders a section of the specified name.
renderSorter ( ) : string Renders the sorter.
renderSummary ( ) Renders the summary text.
run ( ) Runs the widget.

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

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

Initializes the view.
public init ( )

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

Renders the HTML content indicating that the list view has no data.
См. также: emptyText
public renderEmpty ( ) : string
Результат string the rendering result

renderItems() абстрактный публичный Метод

Renders the data models.
abstract public renderItems ( ) : string
Результат string the rendering result.

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

Renders the pager.
public renderPager ( ) : string
Результат string the rendering result

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

If the named section is not supported, false will be returned.
public renderSection ( string $name ) : string | boolean
$name string the section name, e.g., `{summary}`, `{items}`.
Результат string | boolean the rendering result of the section, or false if the named section is not supported.

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

Renders the sorter.
public renderSorter ( ) : string
Результат string the rendering result

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

Renders the summary text.
public renderSummary ( )

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

Runs the widget.
public run ( )

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

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

the data provider for the view. This property is required.
public $dataProvider

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

the HTML content to be displayed when [[dataProvider]] does not have any data.
public $emptyText

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

the HTML attributes for the emptyText of the list view. The "tag" element specifies the tag name of the emptyText element and defaults to "div".
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $emptyTextOptions

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

the layout that determines how different sections of the list view should be organized. The following tokens will be replaced with the corresponding section contents: - {summary}: the summary section. See BaseListView::renderSummary. - {items}: the list items. See BaseListView::renderItems. - {sorter}: the sorter. See BaseListView::renderSorter. - {pager}: the pager. See BaseListView::renderPager.
public $layout

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

the HTML attributes for the container tag of the list view. The "tag" element specifies the tag name of the container element and defaults to "div".
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $options

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

the configuration for the pager widget. By default, LinkPager will be used to render the pager. You can use a different widget class by configuring the "class" element. Note that the widget must support the pagination property which will be populated with the [[\yii\data\BaseDataProvider::pagination|pagination]] value of the [[dataProvider]].
public $pager

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

whether to show the list view if [[dataProvider]] returns no data.
public $showOnEmpty

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

the configuration for the sorter widget. By default, LinkSorter will be used to render the sorter. You can use a different widget class by configuring the "class" element. Note that the widget must support the sort property which will be populated with the [[\yii\data\BaseDataProvider::sort|sort]] value of the [[dataProvider]].
public $sorter

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

the HTML content to be displayed as the summary of the list view. If you do not want to show the summary, you may set it with an empty string. The following tokens will be replaced with the corresponding values: - {begin}: the starting row number (1-based) currently being displayed - {end}: the ending row number (1-based) currently being displayed - {count}: the number of rows currently being displayed - {totalCount}: the total number of rows available - {page}: the page number (1-based) current being displayed - {pageCount}: the number of pages available
public $summary

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

the HTML attributes for the summary of the list view. The "tag" element specifies the tag name of the summary element and defaults to "div".
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $summaryOptions