backend/controllers/MediaController.php
/**
     * Update attributes of Media model via AJAX request.
     */
Update attributes of Media model via AJAX request.
Update attributes of Media model via AJAX request .
public function actionAjaxUpdate()
    {
        if ($model = $this->findModel(Yii::$app->request->post('id'))) {
            $this->getPermission($model);
            $model->{Yii::$app->request->post('attribute')} = Yii::$app->request->post('value');
            $model->save();
        }
    }
public function actionAjaxUpdate ( ) { if ( $ model = $ this -> findModel ( Yii :: $ app -> request -> post ( 'id' ) ) ) { $ this -> getPermission ( $ model ) ; $ model -> { Yii :: $ app -> request -> post ( 'attribute' ) } = Yii :: $ app -> request -> post ( 'value' ) ; $ model -> save ( ) ; } }
Update attributes of Media model via AJAX request.
Update attributes of Media model via AJAX request .