Implemented routing for law show

This commit is contained in:
Kevin Frantz
2018-10-04 20:48:12 +02:00
parent 65c4aea7c8
commit 379e9c62e9
3 changed files with 38 additions and 12 deletions

View File

@@ -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;