forked from projects/file-explorer
add table for displaying dir content
This commit is contained in:
20
src/Controller/HomeController.php
Normal file
20
src/Controller/HomeController.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
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: '/', name: 'app_home', methods: Request::METHOD_GET)]
|
||||
public function __invoke(
|
||||
FileSystemService $fileSystemService
|
||||
): Response
|
||||
{
|
||||
return $this->render('home.html.twig', ['content' => $fileSystemService->getDirs()]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user