Skip to content

Commit f149dcf

Browse files
committed
minor symfony#3739 [book] [forms] misc. fixes and tweaks (javiereguiluz)
This PR was merged into the 2.3 branch. Discussion ---------- [book] [forms] misc. fixes and tweaks | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3+ | Fixed tickets | - Commits ------- 1583f3b [book] [forms] minor fixes and rewordings d4336b7 [book] [forms] misc. fixes and tweaks
2 parents ce582ec + 1583f3b commit f149dcf

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

book/forms.rst

+13-11
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ learning the most important features of the form library along the way.
1313

1414
The Symfony Form component is a standalone library that can be used outside
1515
of Symfony2 projects. For more information, see the `Symfony2 Form component`_
16-
on Github.
16+
on GitHub.
1717

1818
.. index::
1919
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
3939
{
4040
return $this->task;
4141
}
42+
4243
public function setTask($task)
4344
{
4445
$this->task = $task;
@@ -48,7 +49,7 @@ going to need to build a form. But before you begin, first focus on the generic
4849
{
4950
return $this->dueDate;
5051
}
51-
52+
5253
public function setDueDate(\DateTime $dueDate = null)
5354
{
5455
$this->dueDate = $dueDate;
@@ -172,7 +173,7 @@ helper functions:
172173

173174
That's it! By printing ``form(form)``, each field in the form is rendered, along
174175
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,
176177
it's not very flexible (yet). Usually, you'll want to render each form field
177178
individually so you can control how the form looks. You'll learn how to do
178179
that in the ":ref:`form-rendering-template`" section.
@@ -267,7 +268,8 @@ possible paths:
267268
.. note::
268269

269270
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.
271273

272274
.. index::
273275
single: Forms; Multiple Submit Buttons
@@ -566,7 +568,7 @@ First, we need to add the two buttons to the form::
566568

567569
Then, we configure the button for returning to the previous step to run
568570
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::
570572

571573
$form = $this->createFormBuilder($task)
572574
// ...
@@ -979,10 +981,10 @@ to the ``form()`` or the ``form_start()`` helper:
979981
.. note::
980982

981983
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.
983985
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
986988
":doc:`/cookbook/routing/method_parameters`" for more information.
987989

988990
.. index::
@@ -1076,7 +1078,8 @@ the choice is ultimately up to you.
10761078

10771079
public function buildForm(FormBuilderInterface $builder, array $options)
10781080
{
1079-
$builder->add('task')
1081+
$builder
1082+
->add('task')
10801083
->add('dueDate', null, array('mapped' => false))
10811084
->add('save', 'submit');
10821085
}
@@ -1316,8 +1319,7 @@ the ``cascade_validation`` option to ``TaskType``::
13161319
));
13171320
}
13181321
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:
13211323
13221324
.. configuration-block::
13231325

0 commit comments

Comments
 (0)