@@ -13,7 +13,7 @@ learning the most important features of the form library along the way.
13
13
14
14
The Symfony Form component is a standalone library that can be used outside
15
15
of Symfony2 projects. For more information, see the `Symfony2 Form component `_
16
- on Github .
16
+ on GitHub .
17
17
18
18
.. index ::
19
19
single: Forms; Create a simple form
@@ -39,6 +39,7 @@ going to need to build a form. But before you begin, first focus on the generic
39
39
{
40
40
return $this->task;
41
41
}
42
+
42
43
public function setTask($task)
43
44
{
44
45
$this->task = $task;
@@ -48,7 +49,7 @@ going to need to build a form. But before you begin, first focus on the generic
48
49
{
49
50
return $this->dueDate;
50
51
}
51
-
52
+
52
53
public function setDueDate(\DateTime $dueDate = null)
53
54
{
54
55
$this->dueDate = $dueDate;
@@ -566,7 +567,7 @@ First, we need to add the two buttons to the form::
566
567
567
568
Then, we configure the button for returning to the previous step to run
568
569
specific validation groups. In this example, we want it to suppress validation,
569
- so we set its ``validation_groups `` options to false::
570
+ so we set its ``validation_groups `` option to false::
570
571
571
572
$form = $this->createFormBuilder($task)
572
573
// ...
@@ -979,10 +980,10 @@ to the ``form()`` or the ``form_start()`` helper:
979
980
.. note ::
980
981
981
982
If the form's method is not GET or POST, but PUT, PATCH or DELETE, Symfony2
982
- will insert a hidden field with the name " _method" that stores this method.
983
+ will insert a hidden field with the name `` _method `` that stores this method.
983
984
The form will be submitted in a normal POST request, but Symfony2's router
984
- is capable of detecting the " _method" parameter and will interpret the
985
- request as PUT, PATCH or DELETE request. Read the cookbook chapter
985
+ is capable of detecting the `` _method `` parameter and will interpret it as
986
+ a PUT, PATCH or DELETE request. Read the cookbook chapter
986
987
":doc: `/cookbook/routing/method_parameters `" for more information.
987
988
988
989
.. index ::
@@ -1076,7 +1077,8 @@ the choice is ultimately up to you.
1076
1077
1077
1078
public function buildForm(FormBuilderInterface $builder, array $options)
1078
1079
{
1079
- $builder->add('task')
1080
+ $builder
1081
+ ->add('task')
1080
1082
->add('dueDate', null, array('mapped' => false))
1081
1083
->add('save', 'submit');
1082
1084
}
@@ -1316,8 +1318,7 @@ the ``cascade_validation`` option to ``TaskType``::
1316
1318
));
1317
1319
}
1318
1320
1319
- Render the ``Category`` fields in the same way
1320
- as the original ``Task`` fields:
1321
+ Render the ``Category`` fields in the same way as the original ``Task`` fields:
1321
1322
1322
1323
.. configuration-block::
1323
1324
0 commit comments