/** * Creates a new MOrder model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new MOrder(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->order_id]); } else { return $this->render('create', ['model' => $model]); } }
public function actionCreate() { $model = new MOrder(); if (\Yii::$app->request->isPost) { $model->load(\Yii::$app->request->post()); if ($model->save()) { return $this->redirect(['index']); } else { U::W($model->getErrors()); } } return $this->render('create', ['model' => $model]); }