Website/app/backend/TestController.php
Snoweuph d0ec79fd71
Some checks failed
Quality Check / QS Frontend (push) Failing after 13s
Quality Check / QS Mixed (push) Failing after 11s
Quality Check / QS Backend (push) Successful in 14s
Use Symfony UX Twig
2024-07-21 12:53:00 +02:00

34 lines
685 B
PHP

<?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(
'sites/index.html.twig'
)
);
}
}