forked from projects/file-explorer
22
src/Controller/HomeController.php
Normal file
22
src/Controller/HomeController.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Forms\UploadFileForm;
|
||||
use App\Service\FileSystemService;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
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
|
||||
{
|
||||
return $this->render('home.html.twig', [
|
||||
'content' => $fileSystemService->getDirs(),
|
||||
'fileForm' => $this->createForm(UploadFileForm::class),
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user