Ejemplo n.º 1
0
 /**
  * Creates a new MenuItem model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate($menuId)
 {
     $model = new MenuItem();
     $model->menu_id = $menuId;
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['index', 'id' => $model->menu_id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }