@@ -199,6 +199,8 @@ use the ``createForm()`` helper (otherwise, use the ``create()`` method of the
199
199
``form.factory `` service)::
200
200
201
201
// src/Controller/TaskController.php
202
+ namespace App\Controller;
203
+
202
204
use App\Form\Type\TaskType;
203
205
// ...
204
206
@@ -229,6 +231,8 @@ So, while not always necessary, it's generally a good idea to explicitly specify
229
231
the ``data_class `` option by adding the following to your form type class::
230
232
231
233
// src/Form/Type/TaskType.php
234
+ namespace App\Form\Type;
235
+
232
236
use App\Entity\Task;
233
237
use Symfony\Component\OptionsResolver\OptionsResolver;
234
238
// ...
@@ -519,6 +523,8 @@ object.
519
523
.. code-block :: php
520
524
521
525
// src/Entity/Task.php
526
+ namespace App\Entity;
527
+
522
528
use Symfony\Component\Validator\Constraints\NotBlank;
523
529
use Symfony\Component\Validator\Constraints\Type;
524
530
use Symfony\Component\Validator\Mapping\ClassMetadata;
@@ -555,6 +561,8 @@ the form in the controller you can pass custom options to it as the third option
555
561
argument of ``createForm() ``::
556
562
557
563
// src/Controller/TaskController.php
564
+ namespace App\Controller;
565
+
558
566
use App\Form\Type\TaskType;
559
567
// ...
560
568
@@ -579,6 +587,8 @@ If you try to use the form now, you'll see an error message: *The option
579
587
options they accept using the ``configureOptions() `` method::
580
588
581
589
// src/Form/Type/TaskType.php
590
+ namespace App\Form\Type;
591
+
582
592
use Symfony\Component\OptionsResolver\OptionsResolver;
583
593
// ...
584
594
@@ -758,6 +768,8 @@ If you want to modify this, use the :method:`Symfony\\Component\\Form\\FormFacto
758
768
method::
759
769
760
770
// src/Controller/TaskController.php
771
+ namespace App\Controller;
772
+
761
773
use App\Form\TaskType;
762
774
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
763
775
0 commit comments