如何CActiveDataProvider
不使用直接获取数据CGridView
?
控制器.php
public function actionList($id)
{
$criteria = new CDbCriteria;
$dataProvider=new CActiveDataProvider('Events', array(
'criteria' => $criteria
));
$this->render('list',array(
'dataProvider'=>$dataProvider,
));
}
查看.php:
<?php echo $dataProvider->name; ?> // Return Error