We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 447a4c3 commit 33a2fc5Copy full SHA for 33a2fc5
forms.rst
@@ -680,13 +680,17 @@ choice is ultimately up to you.
680
681
// src/AppBundle/Controller/DefaultController.php
682
use AppBundle\Form\TaskType;
683
+ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
684
- public function newAction()
685
+ class DefaultController extends AbstractController
686
{
- $task = ...;
687
- $form = $this->container->get('form.factory')->createNamed('name', TaskType::class, $task);
+ public function newAction()
688
+ {
689
+ $task = ...;
690
+ $form = $this->get('form.factory')->createNamed('name', TaskType::class, $task);
691
- // ...
692
+ // ...
693
+ }
694
}
695
696
You can even suppress the name completely by setting it to an empty string.
0 commit comments