frontend/controllers/inventory/InventoryController.php
/**
     * Creates a new Inventory model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
Creates a new Inventory model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new Inventory model . If creation is successful the browser will be redirected to the ' view ' page . @return mixed
public function actionCreate()
    {
        $model = new Inventory();
        $model->date_created = date('Y-m-d');
        $model->space_id = User::findOne(Yii::$app->user->getId())->space_id;
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['index']);
        }
        return $this->render('create', [
            'model' => $model,
        ]);
    }
public function actionCreate ( ) { $ model = new Inventory ( ) ; $ model -> date_created = date ( 'Y-m-d' ) ; $ model -> space_id = User :: findOne ( Yii :: $ app -> user -> getId ( ) ) -> space_id ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { return $ this -> redirect ( [ 'index' ] ) ; } return $ this -> render ( 'create' , [ 'model' => $ model , ] ) ; }
Creates a new Inventory model.
Creates a new Inventory model .