public function browse(Request $request, $namespace, $path)
    {
        $directory = $this->filesystem()->getDir("$namespace://$path");
        $listing = new Listing($directory);
        $showHidden = $this->isAllowed('files:hidden');

        try {
            $directories = $listing->getDirectories($showHidden);
            $files = $listing->getFiles($showHidden);
        } catch (IOException $e) {
            $this->logException(Trans::__('page.file-management.message.folder-not-found', ['%s' => $path]), $e);
            $directories = [];
            $files = [];
        }

        $context = [
            'directory'   => $directory,
            'directories' => $directories,
            'files'       => $files,
            'multiselect' => $request->query->getBoolean('multiselect'),
        ];

        return $this->render('@bolt/async/browse.twig', ['context' => $context]);
    }
public function browse(Request $request, $namespace, $path)
    {
        $directory = $this->filesystem()->getDir("$namespace://$path");
        $listing = new Listing($directory);
        $showHidden = $this->isAllowed('files:hidden');

        try {
            $directories = $listing->getDirectories($showHidden);
            $files = $listing->getFiles($showHidden);
        } catch (IOException $e) {
            $this->logException(Trans::__('page.file-management.message.folder-not-found', ['%s' => $path]), $e);
            $directories = [];
            $files = [];
        }

        $context = [
            'directory'   => $directory,
            'directories' => $directories,
            'files'       => $files,
            'multiselect' => $request->query->getBoolean('multiselect'),
        ];

        return $this->render('@bolt/async/browse.twig', ['context' => $context]);
    }
public function browse ( Request $ request , $ namespace , $ path ) { $ directory = $ this -> filesystem ( ) -> getDir ( "$namespace://$path" ) ; $ listing = new Listing ( $ directory ) ; $ showHidden = $ this -> isAllowed ( 'files:hidden' ) ; try { $ directories = $ listing -> getDirectories ( $ showHidden ) ; $ files = $ listing -> getFiles ( $ showHidden ) ; } catch ( IOException $ e ) { $ this -> logException ( Trans :: __ ( 'page.file-management.message.folder-not-found' , [ '%s' => $ path ] ) , $ e ) ; $ directories = [ ] ; $ files = [ ] ; } $ context = [ 'directory' => $ directory , 'directories' => $ directories , 'files' => $ files , 'multiselect' => $ request -> query -> getBoolean ( 'multiselect' ) , ] ; return $ this -> render ( '@bolt/async/browse.twig' , [ 'context' => $ context ] ) ; }
List browse on the server, so we can insert them in the file input.

@param Request $request
@param string  $namespace
@param string  $path

@return \Bolt\Response\TemplateResponse
List browse on the server so we can insert them in the file input .