public function actionList($status = 0) { $model = new Zakaz('search'); $model->unsetAttributes(); if (User::model()->isAuthor()) { $model->executor = 0; $model->status = 3; $user = User::model()->findByPk(Yii::app()->user->id); $fields = $model->getFields(); foreach ($fields as $field) { if ($field->field_type == 'LIST') { $tmp = $field->varname; $model->{$tmp} = $user->profile->{$tmp}; } } } $this->render('list', array('model' => $model)); }