Clistview in yii Undefined variable dataProvider

后端 未结 1 1722
执笔经年
执笔经年 2021-01-29 02:37

I need a list view in my index.php. This is does not have any model so I used CSqlDataProvider for declaring the data provider and rendering it

1条回答
  •  北海茫月
    2021-01-29 02:48

    Your itemView cannot be index. It has to be a partial view that will render the items in your list. $dataProvider is available when the list is being rendered but not when the items are being rendered hence the error. For more information http://www.yiiframework.com/doc/api/1.1/CListView#itemView-detail

    0 讨论(0)
提交回复
热议问题