Skip to content

Commit d49c5a5

Browse files
authored
Update Form Page
1 parent d7eedd0 commit d49c5a5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

forms.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ use the ``createForm()`` helper (otherwise, use the ``create()`` method of the
199199
``form.factory`` service)::
200200

201201
// src/Controller/TaskController.php
202+
namespace App\Controller;
203+
202204
use App\Form\Type\TaskType;
203205
// ...
204206

@@ -229,6 +231,8 @@ So, while not always necessary, it's generally a good idea to explicitly specify
229231
the ``data_class`` option by adding the following to your form type class::
230232

231233
// src/Form/Type/TaskType.php
234+
namespace App\Form\Type;
235+
232236
use App\Entity\Task;
233237
use Symfony\Component\OptionsResolver\OptionsResolver;
234238
// ...
@@ -519,6 +523,8 @@ object.
519523
.. code-block:: php
520524
521525
// src/Entity/Task.php
526+
namespace App\Entity;
527+
522528
use Symfony\Component\Validator\Constraints\NotBlank;
523529
use Symfony\Component\Validator\Constraints\Type;
524530
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
555561
argument of ``createForm()``::
556562

557563
// src/Controller/TaskController.php
564+
namespace App\Controller;
565+
558566
use App\Form\Type\TaskType;
559567
// ...
560568

@@ -579,6 +587,8 @@ If you try to use the form now, you'll see an error message: *The option
579587
options they accept using the ``configureOptions()`` method::
580588

581589
// src/Form/Type/TaskType.php
590+
namespace App\Form\Type;
591+
582592
use Symfony\Component\OptionsResolver\OptionsResolver;
583593
// ...
584594

@@ -758,6 +768,8 @@ If you want to modify this, use the :method:`Symfony\\Component\\Form\\FormFacto
758768
method::
759769

760770
// src/Controller/TaskController.php
771+
namespace App\Controller;
772+
761773
use App\Form\TaskType;
762774
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
763775

0 commit comments

Comments
 (0)