<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
/**
* Class DefaultController
* @package App\Controller
*/
class DefaultController extends AbstractController
{
#[Route('/', name: 'home')]
public function index(): Response
{
if ($this->isGranted('ROLE_ADMIN') === true) {
return $this->redirectToRoute('admin.index');
}
return $this->render(
'default/index.html.twig',
[]
);
}
#[Route('form/', name: 'form_list')]
public function formList(): Response
{
return $this->render(
'default/form.html.twig',
[]
);
}
#[Route('/phpinfo', name: 'info', condition: "'dev' === '%kernel.environment%'")]
public function info(): Response
{
ob_start();
phpinfo();
$phpInfo = ob_get_clean();
return $this->render(
'default/info.html.twig',
[
"info" => $phpInfo,
]
);
}
}