I am working on a job site,And want to show only the jobs posted by a particular user in cgridview.My actuall aim is to authenticate the user so that only jobs posted by him/her will be visible in cgridview.I have done the following stuff,but not working. In controller: public function actionViewJob() { $user_id = Yii::app()->session['user_id']; […]
У меня есть код в моем контроллере, public function actionViewJob() { $user_id = Yii::app()->session['user_id']; /* For User Authentication */ if (Yii::app()->user->getId() === null) $this->redirect(array('site/login')); /* For User Authentication */ $model=ViewJob::model()->findAll(array('user_id'=>Yii::app()->user->id)); $params = array('model' => $model, ); $this->render('viewjob', $params); Я получаю ошибку / * Свойство «CDbCriteria.user_id» не определено. * /, но когда я использую findByAttrinute свой […]