Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Form] Fixed TimeType not to render a "size" attribute in select tags #7155

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

Merged
merged 1 commit into from
Feb 22, 2013

Conversation

webmozart
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #6153
License MIT
Doc PR -

@@ -1,17 +1,18 @@
<?php if ($widget == 'single_text'): ?>
<?php echo $view['form']->block($form, 'form_widget_simple'); ?>
<?php else: ?>
<?php $vars = $widget == 'text' ? array('attr' => array('size' => 1)) : array() ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'text' === $widget

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this consistent with line 1. Feel free to create a PR fixing all templates (including the Twig ones) to use YODA style.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Twig CS don't include Yoda condition (the main reason for Yoda condition is to avoid mistakes like $widget = 'text' ? ... and it does not apply to Twig as it would be a syntax error)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever the reason, usage should be consistent IMO.

fabpot added a commit that referenced this pull request Feb 22, 2013
This PR was merged into the 2.1 branch.

Commits
-------

b7bd630 [Form] Fixed TimeType not to render a "size" attribute in select tags

Discussion
----------

[Form] Fixed TimeType not to render a "size" attribute in select tags

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #6153
| License       | MIT
| Doc PR        | -
@fabpot fabpot merged commit b7bd630 into symfony:2.1 Feb 22, 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