@@ -382,7 +382,7 @@ corresponding errors printed out with the form.
382
382
blank fields.
383
383
384
384
Validation is a very powerful feature of Symfony2 and has its own
385
- :doc: `dedicated chapter</book/validation> `.
385
+ :doc: `dedicated chapter </book/validation >`.
386
386
387
387
.. index ::
388
388
single: Forms; Validation groups
@@ -399,7 +399,7 @@ you'll need to specify which validation group(s) your form should use::
399
399
'validation_groups' => array('registration'),
400
400
))->add(...);
401
401
402
- If you're creating :ref: `form classes<book-form-creating-form-classes> ` (a
402
+ If you're creating :ref: `form classes <book-form-creating-form-classes >` (a
403
403
good practice), then you'll need to add the following to the ``setDefaultOptions() ``
404
404
method::
405
405
@@ -484,7 +484,7 @@ Field Type Options
484
484
485
485
Each field type has a number of options that can be used to configure it.
486
486
For example, the ``dueDate `` field is currently being rendered as 3 select
487
- boxes. However, the :doc: `date field</reference/forms/types/date> ` can be
487
+ boxes. However, the :doc: `date field </reference/forms/types/date >` can be
488
488
configured to be rendered as a single text box (where the user would enter
489
489
the date as a string in the box)::
490
490
@@ -503,7 +503,8 @@ the documentation for each type.
503
503
any field. By default, the ``required `` option is set to ``true ``, meaning
504
504
that HTML5-ready browsers will apply client-side validation if the field
505
505
is left blank. If you don't want this behavior, either set the ``required ``
506
- option on your field to ``false `` or :ref: `disable HTML5 validation<book-forms-html5-validation-disable> `.
506
+ option on your field to ``false `` or
507
+ :ref: `disable HTML5 validation <book-forms-html5-validation-disable >`.
507
508
508
509
Also note that setting the ``required `` option to ``true `` will **not **
509
510
result in server-side validation to be applied. In other words, if a
@@ -656,7 +657,7 @@ Take a look at each part:
656
657
It's usually a good idea to place a call to this helper at the bottom of
657
658
each form (in case you forgot to output a field or don't want to bother
658
659
manually rendering hidden fields). This helper is also useful for taking
659
- advantage of the automatic :ref: `CSRF Protection<forms-csrf> `.
660
+ advantage of the automatic :ref: `CSRF Protection <forms-csrf >`.
660
661
661
662
The majority of the work is done by the ``form_row `` helper, which renders
662
663
the label, errors and HTML form widget of each field inside a ``div `` tag
@@ -789,7 +790,7 @@ Twig Template Function Reference
789
790
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
790
791
791
792
If you're using Twig, a full reference of the form rendering functions is
792
- available in the :doc: `reference manual</reference/forms/twig_reference> `.
793
+ available in the :doc: `reference manual </reference/forms/twig_reference >`.
793
794
Read this to know everything about the helpers available and the options
794
795
that can be used with each.
795
796
@@ -984,7 +985,7 @@ HTML form and then translate user-submitted data back to the original object. As
984
985
such, the topic of persisting the ``Task`` object to the database is entirely
985
986
unrelated to the topic of forms. But, if you've configured the ``Task`` class
986
987
to be persisted via Doctrine (i.e. you've added
987
- :ref:`mapping metadata<book-doctrine-adding-mapping>` for it), then persisting
988
+ :ref:`mapping metadata <book-doctrine-adding-mapping>` for it), then persisting
988
989
it after a form submission can be done when the form is valid::
989
990
990
991
if ($form->isValid()) {
@@ -1000,7 +1001,7 @@ you can fetch it from the form::
1000
1001
1001
1002
$task = $form->getData();
1002
1003
1003
- For more information, see the :doc:`Doctrine ORM chapter</book/doctrine>`.
1004
+ For more information, see the :doc:`Doctrine ORM chapter </book/doctrine>`.
1004
1005
1005
1006
The key thing to understand is that when the form is bound, the submitted
1006
1007
data is transferred to the underlying object immediately. If you want to
@@ -1165,7 +1166,7 @@ form with many ``Product`` sub-forms). This is done by using the ``collection``
1165
1166
field type.
1166
1167
1167
1168
For more information see the " :doc:`/cookbook/form/form_collections`" cookbook
1168
- entry and the :doc:`collection</reference/forms/types/collection>` field type reference.
1169
+ entry and the :doc:`collection </reference/forms/types/collection>` field type reference.
1169
1170
1170
1171
.. index::
1171
1172
single: Forms; Theming
@@ -1353,7 +1354,7 @@ override the default error rendering for *all* fields, copy and customize the
1353
1354
.. tip::
1354
1355
1355
1356
The " parent" type of each field type is available in the
1356
- :doc:`form type reference</reference/forms/types>` for each field type.
1357
+ :doc:`form type reference </reference/forms/types>` for each field type.
1357
1358
1358
1359
.. index::
1359
1360
single: Forms; Global Theming
@@ -1642,7 +1643,7 @@ array of your submitted data, how can you add constraints to the data of your
1642
1643
form?
1643
1644
1644
1645
The answer is to setup the constraints yourself, and attach them to the individual
1645
- fields. The overall approach is covered a bit more in the :ref:`validation chapter<book-validation-raw-values>`,
1646
+ fields. The overall approach is covered a bit more in the :ref:`validation chapter <book-validation-raw-values>`,
1646
1647
but here's a short example:
1647
1648
1648
1649
.. versionadded:: 2.1
@@ -1688,11 +1689,11 @@ take the data submitted by the user and to re-apply it to the object.
1688
1689
1689
1690
There's still much more to learn about the powerful world of forms, such as
1690
1691
how to handle :doc:`file uploads with Doctrine
1691
- </cookbook/doctrine/file_uploads>` or how to create a form where a dynamic
1692
+ </cookbook/doctrine/file_uploads>` or how to create a form where a dynamic
1692
1693
number of sub-forms can be added (e.g. a todo list where you can keep adding
1693
1694
more fields via Javascript before submitting). See the cookbook for these
1694
1695
topics. Also, be sure to lean on the
1695
- :doc:`field type reference documentation</reference/forms/types>`, which
1696
+ :doc:`field type reference documentation </reference/forms/types>`, which
1696
1697
includes examples of how to use each field type and its options.
1697
1698
1698
1699
Learn more from the Cookbook
0 commit comments