Create address on the fly field in event form

This commit is contained in:
2025-04-29 14:31:39 +02:00
parent 27f0bf28e9
commit bb71e084b8
15 changed files with 386 additions and 100 deletions

View File

@@ -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,
]);
}