/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { self::CheckLogin(); $model = new WPages(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['WPages'])) { $model->attributes = $_POST['WPages']; $model->created_time = date('Y-m-d H:i:s'); $model->status = 1; $model->creator = Yii::app()->user->id; if ($model->save()) { $this->redirect(array('update', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }