Skip to content

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

Closed
wants to merge 5 commits into from
Closed

added the example Twig Code for the HTML5 no novalidate attribute #3170

wants to merge 5 commits into from

Conversation

sebastianblum
Copy link
Contributor

Q A
Doc fix? no
New docs? yes, a Twig example was added
Applies to 2.3
Fixed tickets no PR

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

in the form documentation, there is a notice about the no validate HTML5 attribute, but without the twig example.

I added the twig code
@bicpi
Copy link
Contributor

bicpi commented Nov 8, 2013

👍

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 submit button with a formnovalidate attribute?

tested on symfony 2.3
@sebastianblum
Copy link
Contributor Author

For symfony below 2.3 the {{ form(form) }} does not exist.

@bicpi
Copy link
Contributor

bicpi commented Nov 9, 2013

For tabbed code blocks like Twig | PHP you need to add a configuration-block in front: Compare to the code block in this example

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'),
)) ?>
Copy link
Contributor

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

Copy link
Contributor Author

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.

@cordoval
Copy link
Contributor

cordoval commented Nov 9, 2013

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
@weaverryan
Copy link
Member

Hey Sebastian!

I've patched your commits into the 2.3 branch at sha: 1baa428, sha: b33f532, sha: 2e3424f, sha: efb88eb and sha: 34d0be4.

Thanks!

@weaverryan weaverryan closed this Nov 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants