Skip to content

Commit d4336b7

Browse files
committed
[book] [forms] misc. fixes and tweaks
1 parent 9f26da8 commit d4336b7

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

book/forms.rst

+10-9
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;
@@ -566,7 +567,7 @@ First, we need to add the two buttons to the form::
566567

567568
Then, we configure the button for returning to the previous step to run
568569
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::
570571

571572
$form = $this->createFormBuilder($task)
572573
// ...
@@ -979,10 +980,10 @@ to the ``form()`` or the ``form_start()`` helper:
979980
.. note::
980981

981982
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.
983984
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
986987
":doc:`/cookbook/routing/method_parameters`" for more information.
987988

988989
.. index::
@@ -1076,7 +1077,8 @@ the choice is ultimately up to you.
10761077

10771078
public function buildForm(FormBuilderInterface $builder, array $options)
10781079
{
1079-
$builder->add('task')
1080+
$builder
1081+
->add('task')
10801082
->add('dueDate', null, array('mapped' => false))
10811083
->add('save', 'submit');
10821084
}
@@ -1316,8 +1318,7 @@ the ``cascade_validation`` option to ``TaskType``::
13161318
));
13171319
}
13181320
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:
13211322
13221323
.. configuration-block::
13231324

0 commit comments

Comments
 (0)