From 5ade08d549a26e55e3add73fcc41afaafc8f2355 Mon Sep 17 00:00:00 2001 From: Tchama Date: Mon, 14 Sep 2020 18:16:21 +0200 Subject: [PATCH] adding parameter person_id=xx for defaults links in edit_content template --- .../Controller/EntityPersonCRUDController.php | 1 + Resources/views/CRUD/_edit_content.html.twig | 63 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 Resources/views/CRUD/_edit_content.html.twig diff --git a/CRUD/Controller/EntityPersonCRUDController.php b/CRUD/Controller/EntityPersonCRUDController.php index 54ae006ee..2cdad7f5b 100644 --- a/CRUD/Controller/EntityPersonCRUDController.php +++ b/CRUD/Controller/EntityPersonCRUDController.php @@ -40,6 +40,7 @@ class EntityPersonCRUDController extends CRUDController * * @param Request $request * @throws Symfony\Component\HttpKernel\Exception\NotFoundHttpException if the person with given id is not found + * @return Person|null */ protected function getPerson(Request $request): ?Person { diff --git a/Resources/views/CRUD/_edit_content.html.twig b/Resources/views/CRUD/_edit_content.html.twig new file mode 100644 index 000000000..f3ac9a860 --- /dev/null +++ b/Resources/views/CRUD/_edit_content.html.twig @@ -0,0 +1,63 @@ +
+ {% block crud_content_header %} +

{{ ('crud.'~crud_name~'.title_edit')|trans }}

+ {% endblock crud_content_header %} + + {% block crud_content_form %} + {{ form_start(form) }} + + {% block crud_content_form_rows %} + {% for f in form %} + {{ form_row(f) }} + {% endfor %} + {% endblock crud_content_form_rows %} + + {% block crud_content_form_actions %} + + {% endblock %} + + {{ form_end(form) }} + {% endblock %} +