/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreateCart() { $model = new Mainclientstable(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if ($model->dogovorStatus == '') { $model->dogovorStatus = 0; } if (isset($_POST['Mainclientstable'])) { $model->attributes = $_POST['Mainclientstable']; if ($model->name == '') { $model->name = "Нет имени"; } if ($model->save()) { $this->redirect(array('index')); } } //$this->render('createcart',array( $this->render('create', array('model' => $model)); }