2024-07-12 22:56:04 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
|
|
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
use Symfony\Component\HttpKernel\Attribute\AsController;
|
|
|
|
use Symfony\Component\Routing\Annotation\Route;
|
|
|
|
use Twig\Environment;
|
|
|
|
|
|
|
|
#[AsController]
|
|
|
|
#[Route(
|
|
|
|
path: '/',
|
|
|
|
name: 'test',
|
|
|
|
methods: [Request::METHOD_GET]
|
|
|
|
)]
|
|
|
|
final readonly class TestController
|
|
|
|
{
|
|
|
|
public function __construct(
|
|
|
|
private Environment $twig,
|
|
|
|
) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public function __invoke(Request $request): Response
|
|
|
|
{
|
|
|
|
return new Response(
|
|
|
|
$this->twig->render(
|
2024-07-21 12:03:21 +00:00
|
|
|
'sites/index.html.twig'
|
2024-07-12 22:56:04 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|