infinito/application/symfony/src/Controller/DefaultController.php

44 lines
1.4 KiB
PHP
Raw Normal View History

2018-09-05 09:11:08 +02:00
<?php
2018-09-12 23:25:22 +03:00
2018-09-05 09:11:08 +02:00
namespace App\Controller;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Response;
2019-02-15 18:03:57 +01:00
use App\Domain\MVCManagement\MVCRoutineServiceInterface;
use App\Domain\RequestManagement\Action\RequestedActionServiceInterface;
use App\DBAL\Types\ActionType;
use App\Domain\FixtureManagement\FixtureSource\ImpressumFixtureSource;
2019-02-16 17:39:51 +01:00
use App\DBAL\Types\Meta\Right\LayerType;
2018-09-05 09:11:08 +02:00
/**
* This controller offers the standart routes for the template.
*
2018-09-05 09:11:08 +02:00
* @author kevinfrantz
*/
2019-01-05 21:26:36 +01:00
final class DefaultController extends AbstractController
2018-09-05 09:11:08 +02:00
{
2019-02-16 17:39:51 +01:00
/**
* @deprecated Use load via source instead of fixed route
*
* @todo Optimize function!
* @Route("/imprint.{_format}", defaults={"_format"="json"}, name="imprint")
*/
public function imprint(MVCRoutineServiceInterface $mvcRoutineService, RequestedActionServiceInterface $requestedActionService): Response
{
$requestedActionService->setActionType(ActionType::READ);
$requestedActionService->setLayer(LayerType::SOURCE);
$requestedActionService->getRequestedEntity()->setSlug(ImpressumFixtureSource::SLUG);
$view = $mvcRoutineService->process();
2019-02-16 18:02:28 +01:00
return $this->handleView($view);
2019-02-16 17:39:51 +01:00
}
2018-09-12 23:25:22 +03:00
2018-09-05 09:11:08 +02:00
/**
* @Route("/", name="homepage")
*/
public function homepage(): Response
{
2018-09-12 23:25:22 +03:00
return $this->render('standard/homepage.html.twig');
2018-09-05 09:11:08 +02:00
}
}