infinito/application/src/Controller/LawController.php

61 lines
1.3 KiB
PHP
Raw Normal View History

2018-10-03 18:20:53 +02:00
<?php
2018-10-29 19:01:00 +01:00
2018-10-03 18:20:53 +02:00
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Annotation\Route;
2018-10-28 15:25:32 +01:00
use App\Entity\Meta\Law;
use App\Entity\Meta\LawInterface;
2018-10-04 20:23:57 +02:00
2018-10-03 18:20:53 +02:00
/**
* @author kevinfrantz
2018-10-29 19:01:00 +01:00
*
2018-10-04 20:23:57 +02:00
* @todo Implement security!
2018-10-03 18:20:53 +02:00
*/
2018-10-03 18:55:33 +02:00
class LawController extends AbstractEntityController
2018-10-03 18:20:53 +02:00
{
/**
* @Route("/law/{id}.{_format}", defaults={"_format"="html"})
*/
2018-10-04 21:01:45 +02:00
public function show(int $id): Response
2018-10-04 20:23:57 +02:00
{
2018-10-04 21:01:45 +02:00
/**
2018-10-29 19:01:00 +01:00
* @var LawInterface
2018-10-04 21:01:45 +02:00
*/
$law = $this->loadEntityById($id);
$view = $this->view($law, 200)
->setTemplate('law/view/standard.html.twig')
->setTemplateVar('law');
2018-10-29 19:01:00 +01:00
2018-10-04 21:01:45 +02:00
return $this->handleView($view);
2018-10-03 18:20:53 +02:00
}
2018-10-04 20:23:57 +02:00
2018-10-03 18:20:53 +02:00
/**
* @Route("/law/{id}/right.{_format}", defaults={"_format"="html"})
*/
2018-10-04 20:23:57 +02:00
public function right(int $id): RedirectResponse
{
2018-10-29 19:01:00 +01:00
/*
*
* @todo Implement function!
*/
2018-10-03 18:20:53 +02:00
}
2018-10-04 20:23:57 +02:00
2018-10-03 18:20:53 +02:00
/**
* @Route("/law/{id}/node.{_format}", defaults={"_format"="html"})
*/
2018-10-04 20:23:57 +02:00
public function node(int $id): RedirectResponse
{
2018-10-29 19:01:00 +01:00
/*
*
* @todo Implement function!
*/
2018-10-03 18:20:53 +02:00
}
2018-10-04 20:23:57 +02:00
2018-10-03 18:55:33 +02:00
protected function setEntityName(): void
{
$this->entityName = Law::class;
}
2018-10-29 19:01:00 +01:00
}