forked from projects/file-explorer
@ -11,11 +11,17 @@ use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class HomeController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/files', name: 'app_home', methods: [Request::METHOD_GET])]
|
||||
public function __invoke(FileSystemService $fileSystemService): Response
|
||||
#[Route(
|
||||
path: '/files/{dirs?}',
|
||||
name: 'app_home',
|
||||
requirements: ['dirs' => '.+'],
|
||||
defaults: ['dirs' => ''],
|
||||
methods: [Request::METHOD_GET]
|
||||
)]
|
||||
public function __invoke(FileSystemService $fileSystemService, string $dirs): Response
|
||||
{
|
||||
return $this->render('home.html.twig', [
|
||||
'content' => $fileSystemService->getDirs(),
|
||||
'content' => $fileSystemService->getDirs($dirs),
|
||||
'fileForm' => $this->createForm(UploadFileForm::class),
|
||||
]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user