PHP Класс yii\widgets\ListView

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

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

Свойство Тип Описание
$itemOptions the HTML attributes for the container of the rendering result of each data model. This can be either an array specifying the common HTML attributes for rendering each data item, or an anonymous function that returns an array of the HTML attributes. The anonymous function will be called once for every data model returned by [[dataProvider]]. The "tag" element specifies the tag name of the container element and defaults to "div". If "tag" is false, it means no container element will be rendered. If this property is specified as an anonymous function, it should have the following signature: php function ($model, $key, $index, $widget)
$itemView the name of the view for rendering each data item, or a callback (e.g. an anonymous function) for rendering each data item. If it specifies a view name, the following variables will be available in the view: - $model: mixed, the data model - $key: mixed, the key value associated with the data item - $index: integer, the zero-based index of the data item in the items array returned by [[dataProvider]]. - $widget: ListView, this widget instance Note that the view name is resolved into the view file by the current context of the [[view]] object. If this property is specified as a callback, it should have the following signature: php function ($model, $key, $index, $widget)
$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".
$separator the HTML code to be displayed between any two consecutive items.
$viewParams additional parameters to be passed to [[itemView]] when it is being rendered. This property is used only when [[itemView]] is a string representing a view name.

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

Метод Описание
renderItem ( mixed $model, mixed $key, integer $index ) : string Renders a single data model.
renderItems ( ) : string Renders all data models.

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

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

Renders a single data model.
public renderItem ( mixed $model, mixed $key, integer $index ) : string
$model mixed the data model to be rendered
$key mixed the key value associated with the data model
$index integer the zero-based index of the data model in the model array returned by [[dataProvider]].
Результат string the rendering result

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

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

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

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

the HTML attributes for the container of the rendering result of each data model. This can be either an array specifying the common HTML attributes for rendering each data item, or an anonymous function that returns an array of the HTML attributes. The anonymous function will be called once for every data model returned by [[dataProvider]]. The "tag" element specifies the tag name of the container element and defaults to "div". If "tag" is false, it means no container element will be rendered. If this property is specified as an anonymous function, it should have the following signature: php function ($model, $key, $index, $widget)
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $itemOptions

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

the name of the view for rendering each data item, or a callback (e.g. an anonymous function) for rendering each data item. If it specifies a view name, the following variables will be available in the view: - $model: mixed, the data model - $key: mixed, the key value associated with the data item - $index: integer, the zero-based index of the data item in the items array returned by [[dataProvider]]. - $widget: ListView, this widget instance Note that the view name is resolved into the view file by the current context of the [[view]] object. If this property is specified as a callback, it should have the following signature: php function ($model, $key, $index, $widget)
public $itemView

$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

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

the HTML code to be displayed between any two consecutive items.
public $separator

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

additional parameters to be passed to [[itemView]] when it is being rendered. This property is used only when [[itemView]] is a string representing a view name.
public $viewParams