Installed twig with composer require twig command.

This commit is contained in:
Krzysztof Płaczek
2024-10-17 11:49:31 +02:00
parent 718855aaf6
commit cd62d1c0f7
6 changed files with 456 additions and 4 deletions

View File

@@ -2,14 +2,15 @@
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class MainController
class MainController extends AbstractController
{
#[Route('/', name: 'main')]
public function homepage(): Response
{
return new Response('Hello World!');
return $this->render('main/homepage.html.twig', ['variable' => random_int(0, 1e10)]);
}
}