src/apis/StorageController.php
public function actionFilemanagerUpdateCaption()
    {
        $this->checkRouteAccess(self::PERMISSION_ROUTE);
        
        $fileId = Yii::$app->request->post('id', false);
        $captionsText = Yii::$app->request->post('captionsText', false);
        $pageId = Yii::$app->request->post('pageId', 0);
    
        if ($fileId && is_scalar($fileId) && $captionsText) {
            $model = StorageFile::findOne($fileId);
            if ($model) {
                $model->updateAttributes([
                    'caption' => I18n::encode($captionsText),
                ]);
    
                $this->flushApiCache($model->folder_id, $pageId);
    
                return true;
            }
        }
    
        return false;
    }
public function actionFilemanagerUpdateCaption()
    {
        $this->checkRouteAccess(self::PERMISSION_ROUTE);
        
        $fileId = Yii::$app->request->post('id', false);
        $captionsText = Yii::$app->request->post('captionsText', false);
        $pageId = Yii::$app->request->post('pageId', 0);
    
        if ($fileId && is_scalar($fileId) && $captionsText) {
            $model = StorageFile::findOne($fileId);
            if ($model) {
                $model->updateAttributes([
                    'caption' => I18n::encode($captionsText),
                ]);
    
                $this->flushApiCache($model->folder_id, $pageId);
    
                return true;
            }
        }
    
        return false;
    }
public function actionFilemanagerUpdateCaption ( ) { $ this -> checkRouteAccess ( self :: PERMISSION_ROUTE ) ; $ fileId = Yii :: $ app -> request -> post ( 'id' , false ) ; $ captionsText = Yii :: $ app -> request -> post ( 'captionsText' , false ) ; $ pageId = Yii :: $ app -> request -> post ( 'pageId' , 0 ) ; if ( $ fileId && is_scalar ( $ fileId ) && $ captionsText ) { $ model = StorageFile :: findOne ( $ fileId ) ; if ( $ model ) { $ model -> updateAttributes ( [ 'caption' => I18n :: encode ( $ captionsText ) , ] ) ; $ this -> flushApiCache ( $ model -> folder_id , $ pageId ) ; return true ; } } return false ; }
Update the caption of storage file.

@return boolean
Update the caption of storage file .