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