collection-crud/src/Controller/DefaultController.php

21 lines
629 B
PHP

<?php declare(strict_types=1);
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;
class DefaultController extends AbstractController
{
#[Route(path: '/', name: 'homepage')]
public function indexAction(Request $request) : Response
{
// replace this example code with whatever you need
return $this->render('default/index.html.twig', [
'base_dir' => realpath($this->getParameter('kernel.project_dir')) . DIRECTORY_SEPARATOR,
]);
}
}