File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -692,7 +692,19 @@ the choice is ultimately up to you.
692
692
693
693
The form name is automatically generated from the type class name. If you want
694
694
to modify it, use the :method: `Symfony\\ Component\\ Form\\ FormFactoryInterface::createNamed ` method.
695
- You can even suppress the name completely by setting it to an empty string.
695
+ You can even suppress the name completely by setting it to an empty string::
696
+
697
+ // src/Controller/TaskController.php
698
+ use App\Form\TaskType;
699
+
700
+ public function new()
701
+ {
702
+ $task = ...;
703
+ $form = $this->container->get('form.factory')->createNamed('customName', TaskType::class, $task);
704
+
705
+ // ...
706
+ }
707
+
696
708
697
709
Final Thoughts
698
710
--------------
You can’t perform that action at this time.
0 commit comments