mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Implemented view for node
This commit is contained in:
@@ -11,6 +11,7 @@ use FOS\RestBundle\Controller\FOSRestController;
|
||||
use App\Entity\SourceInterface;
|
||||
use App\Creator\Factory\Template\Source\SourceTemplateFormFactory;
|
||||
use App\Creator\Factory\Form\Source\SourceFormFactory;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
|
||||
/**
|
||||
* @todo IMPLEMENT SECURITY!
|
||||
@@ -50,6 +51,16 @@ class SourceController extends FOSRestController
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/source/{id}/node.{_format}", defaults={"_format"="html"})
|
||||
*/
|
||||
public function node(Request $request, int $id): RedirectResponse
|
||||
{
|
||||
$source = $this->loadSource($request, $id);
|
||||
|
||||
return $this->redirectToRoute('app_node_show', ['id' => $source->getNode()->getId()]);
|
||||
}
|
||||
|
||||
private function loadSource(Request $request, int $id): SourceInterface
|
||||
{
|
||||
$source = $this->getDoctrine()
|
||||
|
Reference in New Issue
Block a user