/** * Creates a new Page model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate($id = NULL) { $model = new Page(); if (!is_null($id)) { $model->parent_pages_id = $id; } if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(array('/pages/page/view', 'id' => $model->id)); } return $this->render('create', array('model' => $model)); }