Skip to content

Commit e07d79a

Browse files
DocFXWilliam Pinaud
authored and
William Pinaud
committed
Update Controller.tpl.php to use createView() method by default
1 parent 81eb8d9 commit e07d79a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

templates/crud/controller/Controller.tpl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function new(Request $request, EntityManagerInterface $entityManager): Re
4545

4646
return $this->render('<?= $templates_path ?>/new.html.twig', [
4747
'<?= $entity_twig_var_singular ?>' => $<?= $entity_var_singular ?>,
48-
'form' => $form,
48+
'form' => $form->createView(),
4949
]);
5050
}
5151

@@ -71,7 +71,7 @@ public function edit(Request $request, <?= $entity_class_name ?> $<?= $entity_va
7171

7272
return $this->render('<?= $templates_path ?>/edit.html.twig', [
7373
'<?= $entity_twig_var_singular ?>' => $<?= $entity_var_singular ?>,
74-
'form' => $form,
74+
'form' => $form->createView(),
7575
]);
7676
}
7777

tests/fixtures/make-crud/expected/WithCustomRepository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function new(Request $request, EntityManagerInterface $entityManager): Re
3838

3939
return $this->render('sweet_food/new.html.twig', [
4040
'sweet_food' => $sweetFood,
41-
'form' => $form,
41+
'form' => $form->createView(),
4242
]);
4343
}
4444

@@ -64,7 +64,7 @@ public function edit(Request $request, SweetFood $sweetFood, EntityManagerInterf
6464

6565
return $this->render('sweet_food/edit.html.twig', [
6666
'sweet_food' => $sweetFood,
67-
'form' => $form,
67+
'form' => $form->createView(),
6868
]);
6969
}
7070

0 commit comments

Comments
 (0)