PHP Class Bolt\Controller\Backend\FileManager

Prior to v3.0 this functionality primarily existed in the monolithic Bolt\Controllers\Backend class.
Author: Gawain Lynch ([email protected])
Inheritance: extends BackendBase
Show file Open project: bolt/bolt

Public Methods

Method Description
edit ( Request $request, string $namespace, string $file ) : Response File editor.
manage ( Request $request, string $namespace, string $path ) : TemplateResponse | RedirectResponse The file management browser.

Protected Methods

Method Description
addRoutes ( Silex\ControllerCollection $c )

Private Methods

Method Description
getCodeMirrorPlugins ( Bolt\Filesystem\Handler\FileInterface $file )
getRelatedFiles ( Bolt\Filesystem\Handler\FileInterface $file ) : Bolt\Filesystem\Handler\FileInterface[] Gather related (present) files.
handleEdit ( Symfony\Component\Form\FormInterface $form, Bolt\Filesystem\Handler\FileInterface $file ) : Symfony\Component\HttpFoundation\JsonResponse Handle a file edit POST.
handleUpload ( Symfony\Component\Form\FormInterface $form, Bolt\Filesystem\Handler\DirectoryInterface $directory ) Handle the upload POST.
processUpload ( Bolt\Filesystem\Handler\DirectoryInterface $directory, string $filename, array $fileToProcess ) Process an individual file upload.

Method Details

addRoutes() protected method

protected addRoutes ( Silex\ControllerCollection $c )
$c Silex\ControllerCollection

edit() public method

File editor.
public edit ( Request $request, string $namespace, string $file ) : Response
$request Symfony\Component\HttpFoundation\Request The Symfony Request
$namespace string The filesystem namespace
$file string The file path
return Symfony\Component\HttpFoundation\Response

manage() public method

The file management browser.
public manage ( Request $request, string $namespace, string $path ) : TemplateResponse | RedirectResponse
$request Symfony\Component\HttpFoundation\Request The Symfony Request
$namespace string The filesystem namespace
$path string The path prefix
return Bolt\Response\TemplateResponse | Symfony\Component\HttpFoundation\RedirectResponse