backend/controllers/DishesController.php
/**
     * Creates a new Dishes model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
Creates a new Dishes model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new Dishes model . If creation is successful the browser will be redirected to the ' view ' page . @return mixed
public function actionCreate()
    {
        $model = new Dishes();
        $model->menuId = Menus::find()->max('menuId');;
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->dishId]);
        }
        return $this->render('create', [
            'model' => $model,
        ]);
    }
public function actionCreate ( ) { $ model = new Dishes ( ) ; $ model -> menuId = Menus :: find ( ) -> max ( 'menuId' ) ; ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { return $ this -> redirect ( [ 'view' , 'id' => $ model -> dishId ] ) ; } return $ this -> render ( 'create' , [ 'model' => $ model , ] ) ; }
Creates a new Dishes model.
Creates a new Dishes model .