backend/modules/cms/controllers/ProductListingController.php
/**
     * Updates an existing ProductListing model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
Updates an existing ProductListing model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed
Updates an existing ProductListing 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);
        if ($model->load(Yii::$app->request->post()) && Yii::$app->SetValues->Attributes($model)) {
            if (isset($model->product_id) && $model->product_id != '') {
                $model->product_id = implode(',', $model->product_id);
            }
            if ($model->validate() && $model->save()) {
                Yii::$app->session->setFlash('success', "Data Updated Successfully");
            }
            return $this->redirect(['update', 'id' => $model->id]);
        } return $this->render('update', [
                    'model' => $model,
        ]);
    }
public function actionUpdate ( $ id ) { $ model = $ this -> findModel ( $ id ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && Yii :: $ app -> SetValues -> Attributes ( $ model ) ) { if ( isset ( $ model -> product_id ) && $ model -> product_id != '' ) { $ model -> product_id = implode ( ',' , $ model -> product_id ) ; } if ( $ model -> validate ( ) && $ model -> save ( ) ) { Yii :: $ app -> session -> setFlash ( 'success' , " Data Updated Successfully " ) ; } return $ this -> redirect ( [ 'update' , 'id' => $ model -> id ] ) ; } return $ this -> render ( 'update' , [ 'model' => $ model , ] ) ; }
Updates an existing ProductListing model.
Updates an existing ProductListing model .