-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
added the example Twig Code for the HTML5 no novalidate attribute #3170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
in the form documentation, there is a notice about the no validate HTML5 attribute, but without the twig example. I added the twig code
👍 The PR template should be included in your description. And I think you should also add the equivalent PHP code to the code block plus maybe an example for the |
tested on symfony 2.3
For symfony below 2.3 the {{ form(form) }} does not exist. |
For tabbed code blocks like As it is a PR for the 2.3 branch only, it needs to point to the 2.3 branch, see here. |
|
||
<?php echo $view['form']->form($form, array( | ||
'attr' => array('novalidate' => 'novalidate'), | ||
)) ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think echo let's you get away without a semicolon but careful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would also prefer to add a semicolon, but in the existing examples like http://symfony.com/doc/current/book/forms.html#rendering-the-form there are no semicolons at the end.
i think they are typos |
I added no semicolon at the end of the PHP echo because in all other examples there exists no semicolon
in the form documentation, there is a notice about the no validate HTML5 attribute, but without the twig example.
Symfony 2.3 added the method {{ form(form) }} used in the example