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