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 to the index from the controller. Here is my controller action...
public function actionIndex()
{
$sql="select * from Ads";
$totalItemCount=20;
$dataProvider = new CSqlDataProvider($sql, array(
'totalItemCount' => $totalItemCount,
));
$this->render('index',array('dataProvider'=>$dataProvider));
}
Here is my index.php code....
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'index',
'id'=>'list',
));
I am getting an error
"Undefined variable: dataProvider"