backend/modules/user/controllers/UserController.php
/**
     * Updates an existing User model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
Updates an existing User model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed
Updates an existing User model . If update is successful the browser will be redirected to the ' view ' page . @param integer $id @return mixed
public function actionUpdate($id) {
        $model = $this->findModel($id);
        $user_address = \common\models\UserAddress::find()->where(['user_id' => $id])->all();
        $searchModel = new \common\models\WishListSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
        $dataProvider->query->andWhere(['user_id' => $id]);
        $dataProvider->query->orderBy(['id'=>SORT_DESC]);
        $searchModelOrder = new \common\models\OrderMasterSearch();
        $dataProviderOrder = $searchModelOrder->search(Yii::$app->request->queryParams);
        $dataProviderOrder->query->andWhere(['user_id' => $id]);
        $dataProviderOrder->query->orderBy(['id'=>SORT_DESC]);
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['index']);
        }
        return $this->render('update', [
                    'model' => $model,
                    'user_address' => $user_address,
                    'searchModel' => $searchModel,
                    'dataProvider' => $dataProvider,
                    'searchModelOrder' => $searchModelOrder,
                    'dataProviderOrder' => $dataProviderOrder,
        ]);
    }
public function actionUpdate ( $ id ) { $ model = $ this -> findModel ( $ id ) ; $ user_address = \ common \ models \ UserAddress :: find ( ) -> where ( [ 'user_id' => $ id ] ) -> all ( ) ; $ searchModel = new \ common \ models \ WishListSearch ( ) ; $ dataProvider = $ searchModel -> search ( Yii :: $ app -> request -> queryParams ) ; $ dataProvider -> query -> andWhere ( [ 'user_id' => $ id ] ) ; $ dataProvider -> query -> orderBy ( [ 'id' => SORT_DESC ] ) ; $ searchModelOrder = new \ common \ models \ OrderMasterSearch ( ) ; $ dataProviderOrder = $ searchModelOrder -> search ( Yii :: $ app -> request -> queryParams ) ; $ dataProviderOrder -> query -> andWhere ( [ 'user_id' => $ id ] ) ; $ dataProviderOrder -> query -> orderBy ( [ 'id' => SORT_DESC ] ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { return $ this -> redirect ( [ 'index' ] ) ; } return $ this -> render ( 'update' , [ 'model' => $ model , 'user_address' => $ user_address , 'searchModel' => $ searchModel , 'dataProvider' => $ dataProvider , 'searchModelOrder' => $ searchModelOrder , 'dataProviderOrder' => $ dataProviderOrder , ] ) ; }
Updates an existing User model.
Updates an existing User model .