src/apis/StorageController.php
public function actionDataFolders()
    {
        return $this->getOrSetHasCache('storageApiDataFolders', function () {
            $folders = [];
            foreach (Yii::$app->storage->findFolders() as $key => $folder) {
                $folders[$key] = $folder->toArray();
                $folders[$key]['toggle_open'] = (int) Yii::$app->adminuser->identity->setting->get('foldertree.'.$folder->id);
                $folders[$key]['subfolder'] = Yii::$app->storage->getFolder($folder->id)->hasChild();
            }
            return $folders;
        }, 0, new DbDependency(['sql' => 'SELECT MAX(id) FROM {{%admin_storage_folder}} WHERE is_deleted=false']));
    }
public function actionDataFolders()
    {
        return $this->getOrSetHasCache('storageApiDataFolders', function () {
            $folders = [];
            foreach (Yii::$app->storage->findFolders() as $key => $folder) {
                $folders[$key] = $folder->toArray();
                $folders[$key]['toggle_open'] = (int) Yii::$app->adminuser->identity->setting->get('foldertree.'.$folder->id);
                $folders[$key]['subfolder'] = Yii::$app->storage->getFolder($folder->id)->hasChild();
            }
            return $folders;
        }, 0, new DbDependency(['sql' => 'SELECT MAX(id) FROM {{%admin_storage_folder}} WHERE is_deleted=false']));
    }
public function actionDataFolders ( ) { return $ this -> getOrSetHasCache ( 'storageApiDataFolders' , function ( ) { $ folders = [ ] ; foreach ( Yii :: $ app -> storage -> findFolders ( ) as $ key => $ folder ) { $ folders [ $ key ] = $ folder -> toArray ( ) ; $ folders [ $ key ] [ 'toggle_open' ] = ( int ) Yii :: $ app -> adminuser -> identity -> setting -> get ( 'foldertree.' . $ folder -> id ) ; $ folders [ $ key ] [ 'subfolder' ] = Yii :: $ app -> storage -> getFolder ( $ folder -> id ) -> hasChild ( ) ; } return $ folders ; } , 0 , new DbDependency ( [ 'sql' => 'SELECT MAX(id) FROM {{%admin_storage_folder}} WHERE is_deleted=false' ] ) ) ; }
Get all folders from the storage component.

@return array
Get all folders from the storage component .