backend/controllers/WidgetController.php
/**
     * Update activated widget via ajax.
     *
     * @param $id integer
     */
Update activated widget via ajax.
@param $id integer
Update activated widget via ajax . @param $id integer
public function actionAjaxUpdate($id)
    {
        $model = $this->findModel($id);
        if ($model->load(Yii::$app->request->post())) {
            $model->config = Json::encode($model->config);
            $model->save();
        }
    }
public function actionAjaxUpdate ( $ id ) { $ model = $ this -> findModel ( $ id ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { $ model -> config = Json :: encode ( $ model -> config ) ; $ model -> save ( ) ; } }
Update activated widget via ajax.
Update activated widget via ajax .