mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Implemented routing for law show
This commit is contained in:
@@ -7,6 +7,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use App\Entity\NodeInterface;
|
||||
use App\Entity\Node;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
|
||||
/**
|
||||
* @todo IMPLEMENT SECURITY!
|
||||
@@ -30,6 +31,15 @@ class NodeController extends AbstractEntityController
|
||||
return $this->handleView($view);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/node/{id}/law.{_format}", defaults={"_format"="html"})
|
||||
*/
|
||||
public function law(int $id): RedirectResponse
|
||||
{
|
||||
$lawId = $this->loadEntityById($id)->getLaw()->getId();
|
||||
return $this->redirectToRouteById('app_law_show',$lawId);
|
||||
}
|
||||
|
||||
protected function setEntityName(): void
|
||||
{
|
||||
$this->entityName = Node::class;
|
||||
|
Reference in New Issue
Block a user