@@ -386,7 +386,10 @@ object.
386386 $metadata->addPropertyConstraint('task', new NotBlank()); 
387387
388388 $metadata->addPropertyConstraint('dueDate', new NotBlank()); 
389-  $metadata->addPropertyConstraint('dueDate', new Type('\DateTime')); 
389+  $metadata->addPropertyConstraint( 
390+  'dueDate', 
391+  new Type('\DateTime') 
392+  ); 
390393 } 
391394 } 
392395
@@ -496,7 +499,10 @@ to an array callback::
496499 public function setDefaultOptions(OptionsResolverInterface $resolver) 
497500 { 
498501 $resolver->setDefaults(array( 
499-  'validation_groups' => array('Acme\\AcmeBundle\\Entity\\Client', 'determineValidationGroups'), 
502+  'validation_groups' => array( 
503+  'Acme\AcmeBundle\Entity\Client', 
504+  'determineValidationGroups', 
505+  ), 
500506 )); 
501507 } 
502508
@@ -1082,7 +1088,8 @@ easy to use in your application.
10821088code-block :: xml 
10831089
10841090 <!--  src/Acme/TaskBundle/Resources/config/services.xml -->  
1085-  <service  id =" acme_demo.form.type.task" class =" Acme\TaskBundle\Form\Type\TaskType"  
1091+  <service  id =" acme_demo.form.type.task"  
1092+  class =" Acme\TaskBundle\Form\Type\TaskType"  
10861093 <tag  name =" form.type" alias =" task"  
10871094 </service > 
10881095
@@ -1092,7 +1099,10 @@ easy to use in your application.
10921099 use Symfony\Component\DependencyInjection\Definition; 
10931100
10941101 $container 
1095-  ->register('acme_demo.form.type.task', 'Acme\TaskBundle\Form\Type\TaskType') 
1102+  ->register( 
1103+  'acme_demo.form.type.task', 
1104+  'Acme\TaskBundle\Form\Type\TaskType' 
1105+  ) 
10961106 ->addTag('form.type', array( 
10971107 'alias' => 'task', 
10981108 )) 
@@ -1458,13 +1468,13 @@ rendered (e.g. ``label``, ``widget``, ``errors``, etc). By default, there
14581468are 4 possible *parts * of a form that can be rendered:
14591469
14601470+-------------+--------------------------+---------------------------------------------------------+ 
1461- |  ``label `` |  (e.g. ``form_label ``) |  renders the field's label   | 
1471+ |  ``label `` |  (e.g. ``form_label ``)   |  renders the field's label | 
14621472+-------------+--------------------------+---------------------------------------------------------+ 
1463- |  ``widget `` |  (e.g. ``form_widget ``) |  renders the field's HTML representation   | 
1473+ |  ``widget `` |  (e.g. ``form_widget ``)   |  renders the field's HTML representation | 
14641474+-------------+--------------------------+---------------------------------------------------------+ 
1465- |  ``errors `` |  (e.g. ``form_errors ``) |  renders the field's errors   | 
1475+ |  ``errors `` |  (e.g. ``form_errors ``)   |  renders the field's errors | 
14661476+-------------+--------------------------+---------------------------------------------------------+ 
1467- |  ``row `` |  (e.g. ``form_row ``) |  renders the field's entire row (label, widget & errors)   | 
1477+ |  ``row `` |  (e.g. ``form_row ``)   |  renders the field's entire row (label, widget & errors) | 
14681478+-------------+--------------------------+---------------------------------------------------------+ 
14691479
14701480.. note ::
@@ -1609,7 +1619,6 @@ file:
16091619 - ' AcmeTaskBundle:Form'  
16101620 #  ... 
16111621
1612- 
16131622code-block :: xml 
16141623
16151624 <!--  app/config/config.xml -->  
@@ -1778,6 +1787,11 @@ The answer is to setup the constraints yourself, and attach them to the individu
17781787fields. The overall approach is covered a bit more in the :ref: `validation chapter<book-validation-raw-values> `,
17791788but here's a short example:
17801789
1790+ .. versionadded :: 2.1 
1791+  The ``constraints `` option, which accepts a single constraint or an array
1792+  of constraints (before 2.1, the option was called ``validation_constraint ``,
1793+  and only accepted a single constraint) is new to Symfony 2.1.
1794+ 
17811795.. code-block :: php 
17821796
17831797 use Symfony\Component\Validator\Constraints\Length; 
@@ -1797,15 +1811,14 @@ but here's a short example:
17971811
17981812tip ::
17991813
1800-  If you are using Validation Groups, you need to either reference the  
1801-  ``Default `` group when creating the form, or set the correct group on  
1814+  If you are using Validation Groups, you need to either reference the
1815+  ``Default `` group when creating the form, or set the correct group on
18021816 the constraint you are adding.
1803-   
1817+ 
18041818.. code-block :: php 
18051819
18061820 new NotBlank(array('groups' => array('create', 'update')) 
1807-   
1808-   
1821+ 
18091822
18101823-------------- 
18111824
0 commit comments