我使用的是奴隶数据库,当我切换数据库连接时,这就是我得到的:
这是什么意思?CException
Property "CActiveDataProvider.select" is not defined.
public function actionIndex() {
$criteria = new CDbCriteria();
$criteria->condition = 'user_id = ' . Yii::app()->user->id;
VillageSlaveM::$server_id = Yii::app()->session['user_active_world'];
$dataProvider = new CActiveDataProvider('VillageSlaveM', $criteria);
$this->render('index', array(
'dataProvider' => $dataProvider,
));
}
答案 0 :(得分:5)
而不是行:
$dataProvider = new CActiveDataProvider('VillageSlaveM', $criteria);
试
$dataProvider = new CActiveDataProvider('VillageSlaveM', array('criteria'=>$criteria));
我不确定,但documentation描述了CActiveDataProvider的构造。