add site to view and upload files

Reviewed-on: sites/file-explorer#4
This commit is contained in:
2024-12-05 09:42:25 +00:00
parent 1ec2ed1d00
commit bf226d7e3f
31 changed files with 2178 additions and 6 deletions

View 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),
]);
}
}