backend/controllers/CustomerController.php
/**
     * Creates a new Customer model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
Creates a new Customer model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new Customer model . If creation is successful the browser will be redirected to the ' view ' page . @return mixed
public function actionCreate()
    {
        $model = new Customer();
        if ($model->load(Yii::$app->request->post())) {
            $model->foto=UploadedFile::getInstance($model,'foto');
            $model->save();
             Yii::$app->session->setFlash('success', 'Disimpan');
            return $this->redirect(['view', 'id' => $model->id_customer]);
        }
        return $this->renderAjax('create', [
            'model' => $model,
        ]);
    }
public function actionCreate ( ) { $ model = new Customer ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { $ model -> foto = UploadedFile :: getInstance ( $ model , 'foto' ) ; $ model -> save ( ) ; Yii :: $ app -> session -> setFlash ( 'success' , 'Disimpan' ) ; return $ this -> redirect ( [ 'view' , 'id' => $ model -> id_customer ] ) ; } return $ this -> renderAjax ( 'create' , [ 'model' => $ model , ] ) ; }
Creates a new Customer model.
Creates a new Customer model .