<?php
namespace CoreBundle\Controller;
use CoreBundle\Entity\Info;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
class DefaultController extends AbstractController
{
public function __construct(private readonly EntityManagerInterface $entityManager)
{
}
public function index(string $scope): RedirectResponse
{
if ($scope === 'gale' && $this->isGranted('IS_AUTHENTICATED_FULLY')) {
return $this->redirectToRoute('login_redirect_route');
}
return $this->redirectToRoute('fos_user_security_login');
}
public function showColophon(): Response
{
$colophonBody = $this->entityManager->getRepository(Info::class)->findOneBy(['key' => 'colophon_body']);
return $this->render('@ABaCusCore/Default/colophon/base.html.twig', [
'colophonBody' => $colophonBody ? $colophonBody->getValue() : ''
]);
}
}