Skip to content

Commit

Permalink
minor #53 split the Validation chapter (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.7 branch.

Discussion
----------

split the Validation chapter

Commits
-------

a2c301a split the Validation chapter
  • Loading branch information
javiereguiluz committed Jul 13, 2016
2 parents 6938b8c + a2c301a commit 79af2c1
Show file tree
Hide file tree
Showing 6 changed files with 584 additions and 637 deletions.
6 changes: 3 additions & 3 deletions bundles/override.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ combines them into one validation metadata tree. This means you are able to
add new constraints to a property, but you cannot override them.

To override this, the 3rd party bundle needs to have configuration for
:ref:`validation groups <book-validation-validation-groups>`. For instance,
the FOSUserBundle has this configuration. To create your own validation, add
the constraints to a new validation group:
:doc:`validation groups </validation/groups>`. For instance, the FOSUserBundle
has this configuration. To create your own validation, add the constraints
to a new validation group:

.. configuration-block::

Expand Down
8 changes: 5 additions & 3 deletions forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ Validation is a very powerful feature of Symfony and has its own
Validation Groups
~~~~~~~~~~~~~~~~~

If your object takes advantage of :ref:`validation groups <book-validation-validation-groups>`,
If your object takes advantage of :doc:`validation groups </validation/groups>`,
you'll need to specify which validation group(s) your form should use::

$form = $this->createFormBuilder($users, array(
Expand Down Expand Up @@ -595,7 +595,7 @@ of the entity as well you have to adjust the option as follows::
}

You can find more information about how the validation groups and the default constraints
work in the book section about :ref:`validation groups <book-validation-validation-groups>`.
work in the book section about :doc:`validation groups </validation/groups>`.

.. index::
single: Forms; Validation groups based on clicked button
Expand Down Expand Up @@ -1899,6 +1899,8 @@ an array.
a better choice, since it returns the data (usually an object) after
it's been transformed by the Form component.

.. _booking-validation-forms:

Adding Validation
~~~~~~~~~~~~~~~~~

Expand All @@ -1915,7 +1917,7 @@ simple array of your submitted data, how can you add constraints to the data of
your form?

The answer is to setup the constraints yourself, and attach them to the individual
fields. The overall approach is covered a bit more in the :ref:`validation chapter <book-validation-raw-values>`,
fields. The overall approach is covered a bit more in the :doc:`validation chapter </validation/raw_values>`,
but here's a short example:

.. code-block:: php
Expand Down
Loading

0 comments on commit 79af2c1

Please sign in to comment.