From e07d79a6ab9331a3354e41b654141890a4eb2c43 Mon Sep 17 00:00:00 2001 From: William Pinaud Date: Wed, 4 Jun 2025 13:39:27 +0200 Subject: [PATCH] Update Controller.tpl.php to use createView() method by default --- templates/crud/controller/Controller.tpl.php | 4 ++-- tests/fixtures/make-crud/expected/WithCustomRepository.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/crud/controller/Controller.tpl.php b/templates/crud/controller/Controller.tpl.php index 63901dc58..886ec443e 100644 --- a/templates/crud/controller/Controller.tpl.php +++ b/templates/crud/controller/Controller.tpl.php @@ -45,7 +45,7 @@ public function new(Request $request, EntityManagerInterface $entityManager): Re return $this->render('/new.html.twig', [ '' => $, - 'form' => $form, + 'form' => $form->createView(), ]); } @@ -71,7 +71,7 @@ public function edit(Request $request, $render('/edit.html.twig', [ '' => $, - 'form' => $form, + 'form' => $form->createView(), ]); } diff --git a/tests/fixtures/make-crud/expected/WithCustomRepository.php b/tests/fixtures/make-crud/expected/WithCustomRepository.php index 9dc2eb8e9..38527030f 100644 --- a/tests/fixtures/make-crud/expected/WithCustomRepository.php +++ b/tests/fixtures/make-crud/expected/WithCustomRepository.php @@ -38,7 +38,7 @@ public function new(Request $request, EntityManagerInterface $entityManager): Re return $this->render('sweet_food/new.html.twig', [ 'sweet_food' => $sweetFood, - 'form' => $form, + 'form' => $form->createView(), ]); } @@ -64,7 +64,7 @@ public function edit(Request $request, SweetFood $sweetFood, EntityManagerInterf return $this->render('sweet_food/edit.html.twig', [ 'sweet_food' => $sweetFood, - 'form' => $form, + 'form' => $form->createView(), ]); }