mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Optimized Imprint function
This commit is contained in:
@@ -2,21 +2,28 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use App\DBAL\Types\SystemSlugType;
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class DefaultController extends AbstractController
|
||||
class DefaultController extends AbstractEntityController
|
||||
{
|
||||
/**
|
||||
* @todo Optimize function!
|
||||
* @Route("/imprint", name="imprint")
|
||||
*/
|
||||
public function imprint(): Response
|
||||
{
|
||||
return $this->render('standard/imprint.html.twig');
|
||||
$source = $this->loadEntityBySlug(SystemSlugType::IMPRINT);
|
||||
$view = $this->view($source, 200)
|
||||
->setTemplate('standard/imprint.html.twig')
|
||||
->setTemplateVar('source');
|
||||
|
||||
return $this->handleView($view);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -26,4 +33,9 @@ class DefaultController extends AbstractController
|
||||
{
|
||||
return $this->render('standard/homepage.html.twig');
|
||||
}
|
||||
|
||||
protected function setEntityName(): void
|
||||
{
|
||||
$this->entityName = AbstractSource::class;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user