我是yii2中的新手,我需要将两个变量传递给listview.my listview如下所示。
ListView::widget([
'dataProvider' => $tripMembers,
'id' => '_trip_member_items',
'itemView' => '_members_items',
'itemOptions' => ['tag' => false],
'summary' => '',
'emptyText' => '',
'options' => ['class' => 'details-list', 'tag' => 'ul']
]);
请帮帮我。谢谢。
答案 0 :(得分:2)
我们可以再传递一个变量,
ListView::widget([
'dataProvider' => $tripMembers,
'id' => '_trip_member_items',
'itemView' => '_members_items',
'itemOptions' => ['tag' => false],
'summary' => '',
'emptyText' => '',
'options' => ['class' => 'details-list', 'tag' => 'ul'],
'viewParams'=>['id'=>'121'],
]);
希望它对其他人也有帮助