本文整理匯總了PHP中yii\widgets\ListView::renderItems方法的典型用法代碼示例。如果您正苦於以下問題:PHP ListView::renderItems方法的具體用法?PHP ListView::renderItems怎麽用?PHP ListView::renderItems使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類yii\widgets\ListView
的用法示例。
在下文中一共展示了ListView::renderItems方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderItems
/**
* @inheritdoc
*/
public function renderItems()
{
if ($this->columns < 2) {
parent::renderItems();
return;
}
$models = $this->dataProvider->getModels();
$keys = $this->dataProvider->getKeys();
$rows = [];
$layouts = ArrayHelper::getValue($this->columnsLayout, $this->columns, []);
$this->itemOptions = empty($this->itemOptions) ? $this->buildItemOptions($layouts) : $this->itemOptions;
foreach (array_values($models) as $index => $model) {
$rows[] = $this->renderItem($model, $keys[$index], $index);
// set a clearfix breaks for responsive columns
if ($this->createRows) {
$clearRows = $this->buildClearFixTag($layouts, $index + 1);
if (empty($clearRows)) {
continue;
}
$rows[] = implode("\n", $clearRows);
}
}
return Html::beginTag('div', $this->rowOptions) . implode($this->separator, $rows) . Html::endTag('div');
}
示例2: renderItems
/**
* @inheritdoc
*/
public function renderItems()
{
$this->registerPluginAssets();
return parent::renderItems();
}
示例3: renderItems
public function renderItems()
{
return parent::renderItems();
}