public function actionCreate() { $model = new Supports(); if (isset($_POST['Supports'])) { $model->attributes = $_POST['Supports']; $model->created = time(); if ($model->save()) { Yii::app()->user->setFlash('success', translate('Thêm thành công.')); $this->redirect(PIUrl::createUrl('/admin/support/index')); } } $this->render('create', array('model' => $model)); }
/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $this->addToolbar(); $model = new Supports(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Supports'])) { $model->attributes = $_POST['Supports']; if ($model->save()) { $this->redirect(array('index')); } } $this->render('form', array('model' => $model)); }