Skip to content

Commit 283fbd0

Browse files
ilmoralitojaviereguiluz
authored andcommitted
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
1 parent 541ab96 commit 283fbd0

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)