forked from projects/file-explorer
add file preview
This commit is contained in:
@ -20,6 +20,12 @@ class HomeController extends AbstractController
|
||||
)]
|
||||
public function __invoke(FileSystemService $fileSystemService, string $dirs): Response
|
||||
{
|
||||
if ($fileSystemService->isFile(substr_replace($dirs, '', -1))) {
|
||||
return $this->render('file.html.twig', [
|
||||
'file' => $fileSystemService->getFile((string) substr_replace($dirs, '', -1)),
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->render('home.html.twig', [
|
||||
'content' => $fileSystemService->getDirs($dirs),
|
||||
'fileForm' => $this->createForm(UploadFileForm::class),
|
||||
|
Reference in New Issue
Block a user