Skip to content

Commit 5b8073e

Browse files
weaverryanxabbuh
authored andcommitted
very minor tweaks
1 parent 19fce16 commit 5b8073e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

forms.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ your controller::
232232
$form->handleRequest($request);
233233

234234
if ($form->isSubmitted() && $form->isValid()) {
235+
// the $task object will now contain the submitted data!
235236
// ... perform some action, such as saving the task to the database
236237

237238
return $this->redirectToRoute('task_success');
@@ -257,7 +258,7 @@ your controller::
257258
This controller follows a common pattern for handling forms, and has three
258259
possible paths:
259260

260-
#. When initially loading the page in a browser, the form is simply created and
261+
#. When initially loading the page in a browser, the form is created and
261262
rendered. :method:`Symfony\\Component\\Form\\FormInterface::handleRequest`
262263
recognizes that the form was not submitted and does nothing.
263264
:method:`Symfony\\Component\\Form\\FormInterface::isSubmitted` returns ``false``
@@ -268,7 +269,7 @@ possible paths:
268269
``task`` and ``dueDate`` properties of the ``$task`` object. Then this object
269270
is validated. If it is invalid (validation is covered in the next section),
270271
:method:`Symfony\\Component\\Form\\FormInterface::isValid` returns
271-
``false``, so the form is rendered together with all validation errors;
272+
``false`` and the form is rendered again, but now with validation errors;
272273

273274
#. When the user submits the form with valid data, the submitted data is again
274275
written into the form, but this time :method:`Symfony\\Component\\Form\\FormInterface::isValid`
@@ -286,7 +287,7 @@ possible paths:
286287

287288
If you need more control over exactly when your form is submitted or which
288289
data is passed to it, you can use the :method:`Symfony\\Component\\Form\\FormInterface::submit`
289-
for this. Read more about it :ref:`in the cookbook <cookbook-form-call-submit-directly>`.
290+
method. Read more about it :ref:`in the cookbook <cookbook-form-call-submit-directly>`.
290291

291292
.. index::
292293
single: Forms; Validation
@@ -388,11 +389,14 @@ object.
388389
That's it! If you re-submit the form with invalid data, you'll see the
389390
corresponding errors printed out with the form.
390391

392+
Validation is a very powerful feature of Symfony and has its own
393+
:doc:`dedicated chapter </book/validation>`.
394+
391395
.. _book-forms-html5-validation-disable:
392396

393397
.. sidebar:: HTML5 Validation
394398

395-
As of HTML5, many browsers can natively enforce certain validation constraints
399+
Thanks to HTML5, many browsers can natively enforce certain validation constraints
396400
on the client side. The most common validation is activated by rendering
397401
a ``required`` attribute on fields that are required. For browsers that
398402
support HTML5, this will result in a native browser message being displayed
@@ -420,9 +424,6 @@ corresponding errors printed out with the form.
420424
'attr' => array('novalidate' => 'novalidate'),
421425
)) ?>
422426

423-
Validation is a very powerful feature of Symfony and has its own
424-
:doc:`dedicated chapter </validation>`.
425-
426427
.. index::
427428
single: Forms; Built-in field types
428429

0 commit comments

Comments
 (0)