1
StackoverflowListViewのitemViewでアイテム数を取得する - Yii2
どのようにitemViewカウントを取得しますか。 ListViewの3番目ごとに何かしたい。
echo ListView::widget([
'dataProvider' => $modelDataProvider,
'itemView' => '_item_view',
'viewParams' => [
'count' => $itemcount // How to get this variable?
],
])
// _item_view.php
if($count % 3 == 0) {
// this item is the third in a row, do something special
}
何か助けてください!