Skip to content

Commit 2e3424f

Browse files
sebastianblumweaverryan
authored andcommitted
Added the PHP no validate example
tested on symfony 2.3
1 parent b33f532 commit 2e3424f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

book/forms.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,16 @@ corresponding errors printed out with the form.
420420
but are being prevented by your browser from, for example, submitting
421421
blank fields.
422422

423-
.. code-block:: html+jinja
423+
.. code-block:: html+jinja
424+
425+
{# src/Acme/DemoBundle/Resources/views/Default/new.html.twig #}
426+
{{ form(form, {'attr': {'novalidate': 'novalidate'}}) }}
427+
428+
.. code-block:: html+php
424429

425-
{# src/Acme/DemoBundle/Resources/views/Default/new.html.twig #}
426-
{{ form(form, {'attr': {'novalidate': 'novalidate'}}) }}
430+
<?php echo $view['form']->form($form, array(
431+
'attr' => array('novalidate' => 'novalidate'),
432+
)) ?>
427433

428434
Validation is a very powerful feature of Symfony2 and has its own
429435
:doc:`dedicated chapter </book/validation>`.

0 commit comments

Comments
 (0)