Skip to content

Commit 9c3cf6c

Browse files
committed
minor symfony#11563 Update form documents examples (pshirmanov)
This PR was submitted for the 4.2 branch but it was squashed and merged into the 3.4 branch instead (closes symfony#11563). Discussion ---------- Update form documents examples wrong namespace Commits ------- 9d12a34 Update form documents examples
2 parents 6ef2b7b + 9d12a34 commit 9c3cf6c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

form/form_collections.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ objects::
8484

8585
Then, create a form class so that a ``Tag`` object can be modified by the user::
8686

87-
// src/AppBundle/Form/Type/TagType.php
88-
namespace AppBundle\Form\Type;
87+
// src/AppBundle/Form/TagType.php
88+
namespace AppBundle\Form;
8989

9090
use AppBundle\Entity\Tag;
9191
use Symfony\Component\Form\AbstractType;
@@ -114,8 +114,8 @@ form itself, create a form for the ``Task`` class.
114114
Notice that you embed a collection of ``TagType`` forms using the
115115
:doc:`CollectionType </reference/forms/types/collection>` field::
116116

117-
// src/AppBundle/Form/Type/TaskType.php
118-
namespace AppBundle\Form\Type;
117+
// src/AppBundle/Form/TaskType.php
118+
namespace AppBundle\Form;
119119

120120
use AppBundle\Entity\Task;
121121
use Symfony\Component\Form\AbstractType;
@@ -150,7 +150,7 @@ In your controller, you'll create a new form from the ``TaskType``::
150150

151151
use AppBundle\Entity\Tag;
152152
use AppBundle\Entity\Task;
153-
use AppBundle\Form\Type\TaskType;
153+
use AppBundle\Form\TaskType;
154154
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
155155
use Symfony\Component\HttpFoundation\Request;
156156

@@ -254,7 +254,7 @@ type expects to receive exactly two, otherwise an error will be thrown:
254254
``This form should not contain extra fields``. To make this flexible,
255255
add the ``allow_add`` option to your collection field::
256256

257-
// src/AppBundle/Form/Type/TaskType.php
257+
// src/AppBundle/Form/TaskType.php
258258

259259
// ...
260260
use Symfony\Component\Form\FormBuilderInterface;
@@ -419,7 +419,7 @@ for the tags in the ``Task`` class::
419419

420420
Next, add a ``by_reference`` option to the ``tags`` field and set it to ``false``::
421421

422-
// src/AppBundle/Form/Type/TaskType.php
422+
// src/AppBundle/Form/TaskType.php
423423

424424
// ...
425425
public function buildForm(FormBuilderInterface $builder, array $options)
@@ -551,7 +551,7 @@ The solution is similar to allowing tags to be added.
551551

552552
Start by adding the ``allow_delete`` option in the form Type::
553553

554-
// src/AppBundle/Form/Type/TaskType.php
554+
// src/AppBundle/Form/TaskType.php
555555

556556
// ...
557557
public function buildForm(FormBuilderInterface $builder, array $options)

0 commit comments

Comments
 (0)