Skip to content

Commit fa65333

Browse files
committed
minor #9359 Update forms.rst (ilmoralito)
This PR was submitted for the 4.0 branch but it was merged into the 2.7 branch instead (closes #9359). Discussion ---------- Update forms.rst For the purpose of making it easy to follow the guide, I think the definition of form should be maintained in this example Commits ------- 283fbd0 Update forms.rst
2 parents 541ab96 + 283fbd0 commit fa65333

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

forms.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,14 +424,16 @@ Validation is a very powerful feature of Symfony and has its own
424424
.. code-block:: html+twig
425425

426426
{# app/Resources/views/default/new.html.twig #}
427-
{{ form(form, {'attr': {'novalidate': 'novalidate'}}) }}
427+
{{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }}
428+
{{ form_widget(form) }}
429+
{{ form_end(form) }}
428430

429431
.. code-block:: html+php
430432

431433
<!-- app/Resources/views/default/new.html.php -->
432-
<?php echo $view['form']->form($form, array(
433-
'attr' => array('novalidate' => 'novalidate'),
434-
)) ?>
434+
<?php echo $view['form']->start($form, array('attr' => array('novalidate' => 'novalidate') ?>
435+
<?php echo $view['form']->widget($form) ?>
436+
<?php echo $view['form']->end($form) ?>
435437

436438
.. index::
437439
single: Forms; Built-in field types

0 commit comments

Comments
 (0)