mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
Create address on the fly field in event form
This commit is contained in:
@@ -41,6 +41,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
@@ -59,6 +60,8 @@ final class EventController extends AbstractController
|
||||
private readonly PaginatorFactory $paginator,
|
||||
private readonly Security $security,
|
||||
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
|
||||
private readonly SerializerInterface $serializer,
|
||||
|
||||
) {}
|
||||
|
||||
#[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/event/event/{event_id}/delete', name: 'chill_event__event_delete', requirements: ['event_id' => '\d+'], methods: ['GET', 'POST', 'DELETE'])]
|
||||
@@ -202,9 +205,12 @@ final class EventController extends AbstractController
|
||||
return $this->redirectToRoute('chill_event__event_show', ['event_id' => $entity->getId()]);
|
||||
}
|
||||
|
||||
$entity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
|
||||
|
||||
return $this->render('@ChillEvent/Event/new.html.twig', [
|
||||
'entity' => $entity,
|
||||
'form' => $form->createView(),
|
||||
'entity_json' => $entity_array,
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user