@@ -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;
@@ -172,7 +173,7 @@ helper functions:
172
173
173
174
That's it! By printing ``form(form) ``, each field in the form is rendered, along
174
175
with a label and error message (if there is one). The ``form `` function also
175
- surrounds everything in the necessary HTML ``form `` tag. As easy as this is,
176
+ surrounds everything in the necessary HTML ``< form> `` tag. As easy as this is,
176
177
it's not very flexible (yet). Usually, you'll want to render each form field
177
178
individually so you can control how the form looks. You'll learn how to do
178
179
that in the ":ref: `form-rendering-template `" section.
@@ -267,7 +268,8 @@ possible paths:
267
268
.. note ::
268
269
269
270
Redirecting a user after a successful form submission prevents the user
270
- from being able to hit "refresh" and re-post the data.
271
+ from being able to hit the "Refresh" button of their browser and re-post
272
+ the data.
271
273
272
274
.. index ::
273
275
single: Forms; Multiple Submit Buttons
@@ -566,7 +568,7 @@ First, we need to add the two buttons to the form::
566
568
567
569
Then, we configure the button for returning to the previous step to run
568
570
specific validation groups. In this example, we want it to suppress validation,
569
- so we set its ``validation_groups `` options to false::
571
+ so we set its ``validation_groups `` option to false::
570
572
571
573
$form = $this->createFormBuilder($task)
572
574
// ...
@@ -979,10 +981,10 @@ to the ``form()`` or the ``form_start()`` helper:
979
981
.. note ::
980
982
981
983
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.
984
+ will insert a hidden field with the name `` _method `` that stores this method.
983
985
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
986
+ is capable of detecting the `` _method `` parameter and will interpret it as
987
+ a PUT, PATCH or DELETE request. Read the cookbook chapter
986
988
":doc: `/cookbook/routing/method_parameters `" for more information.
987
989
988
990
.. index ::
@@ -1076,7 +1078,8 @@ the choice is ultimately up to you.
1076
1078
1077
1079
public function buildForm(FormBuilderInterface $builder, array $options)
1078
1080
{
1079
- $builder->add('task')
1081
+ $builder
1082
+ ->add('task')
1080
1083
->add('dueDate', null, array('mapped' => false))
1081
1084
->add('save', 'submit');
1082
1085
}
@@ -1316,8 +1319,7 @@ the ``cascade_validation`` option to ``TaskType``::
1316
1319
));
1317
1320
}
1318
1321
1319
- Render the ``Category`` fields in the same way
1320
- as the original ``Task`` fields:
1322
+ Render the ``Category`` fields in the same way as the original ``Task`` fields:
1321
1323
1322
1324
.. configuration-block::
1323
1325
0 commit comments