public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        $model->setScenario('update');
        Yii::$app->response->format = Response::FORMAT_JSON;
        if ($model->load(Yii::$app->request->post())) {
            if ($model->validate()) {
                if ($model->save(false)) {
                    return $this->renderAjax('@vendor/frenzelgmbh/cm-address/views/widgets/views/_index_single_item', ['model' => $model]);
                } else {
                    Yii::$app->response->setStatusCode(500);
                    return \Yii::t('net_frenzel_address', 'FRONTEND_FLASH_FAIL_UPDATE');
                }
            } elseif (Yii::$app->request->isAjax) {
                Yii::$app->response->setStatusCode(400);
                return ActiveForm::validate($model);
            }
        }
    }
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        $model->setScenario('update');
        Yii::$app->response->format = Response::FORMAT_JSON;
        if ($model->load(Yii::$app->request->post())) {
            if ($model->validate()) {
                if ($model->save(false)) {
                    return $this->renderAjax('@vendor/frenzelgmbh/cm-address/views/widgets/views/_index_single_item', ['model' => $model]);
                } else {
                    Yii::$app->response->setStatusCode(500);
                    return \Yii::t('net_frenzel_address', 'FRONTEND_FLASH_FAIL_UPDATE');
                }
            } elseif (Yii::$app->request->isAjax) {
                Yii::$app->response->setStatusCode(400);
                return ActiveForm::validate($model);
            }
        }
    }
public function actionUpdate ( $ id ) { $ model = $ this -> findModel ( $ id ) ; $ model -> setScenario ( 'update' ) ; Yii :: $ app -> response -> format = Response :: FORMAT_JSON ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { if ( $ model -> validate ( ) ) { if ( $ model -> save ( false ) ) { return $ this -> renderAjax ( '@vendor/frenzelgmbh/cm-address/views/widgets/views/_index_single_item' , [ 'model' => $ model ] ) ; } else { Yii :: $ app -> response -> setStatusCode ( 500 ) ; return \ Yii :: t ( 'net_frenzel_address' , 'FRONTEND_FLASH_FAIL_UPDATE' ) ; } } elseif ( Yii :: $ app -> request -> isAjax ) { Yii :: $ app -> response -> setStatusCode ( 400 ) ; return ActiveForm :: validate ( $ model ) ; } } }
Update Communication.

@param integer $id Communication ID
@return mixed
Update Communication .