Answer the question
In order to leave comments, you need to log in
How to correctly inherit from CActiveRecord in Yii?
Good afternoon,
There is a table ActiveRecord derived from CActiveRecord . From the first I inherited all the models. In ActiveRecord , the only method is:
static function getAll(){
$criteria = new CDbCriteria();
$criteria->condition = 'EXIST = 1';
return self::model()->findAll($criteria);
}
public static function model($className=__CLASS__)
{
return parent::model($className);
}
public function actionIndex()
{
$model = Project::getAll();
$this->render('index',array(
'model'=>$model
));
}
return self::model()->findAll($criteria);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question