-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Radio choice form builder does not render attr #8269
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
Comments
@sargath Please use the mailing-list at https://groups.google.com/forum/?fromgroups#!forum/symfony2 to ask for support. Make sure to post your twig there as well because with your code I get (manually indented) the testClass on the div: <div id="waitinglist_myRadios" class="testClass">
<input type="radio" id="waitinglist_myRadios_0" name="waitinglist[myRadios]" required="required" value="one">
<label for="waitinglist_myRadios_0" class="required">uno</label>
<input type="radio" id="waitinglist_myRadios_1" name="waitinglist[myRadios]" required="required" value="two">
<label for="waitinglist_myRadios_1" class="required">due</label>
</div> |
hmm actually this issue i've posted is same like this http://stackoverflow.com/questions/16571259/symfony-silex-radio-choice-form-builder-does-not-render-attr , and i copied here. What sf2 version you are using ? |
My real class for this is: http://pastebin.com/e7nrppct |
As I said - you should use the mailing-list at https://groups.google.com/forum/?fromgroups#!forum/symfony2 to ask for support. Please close the issue as it’s not a bug. |
Really thx for big help :/ ...i will try to ask, but what is it then ?that not a bug ? If on other fields i get correct value ? |
@sargath You’re using MopaBootstrapBundle which changes the rendering of the fields so it’s not a bug related to Symfony. Please file an issue there. The line rendering the field is here: https://github.com/phiamo/MopaBootstrapBundle/blob/master/Resources/views/Form/fields.html.twig#L56 |
No I'm not using MopaBoostrapBundle, I'm using Sylius project, and in it, there is no bundle as you mentioned, but you gave me a good hint that some thing could overwrite default templates... but rather no, especially that I use default not inherited classes and templates. But OK I'll check this on pure sf project. |
I noticed that :
$builder
->add('myRadios', 'choice', array(
'choices' => array(
'one' => 'uno',
'two' => 'due'),
'multiple' => false,
'attr' => array('class' => 'testClass'),
'expanded' => true
so attr with class is not rendered:
the output is:
http://pastebin.com/cAqLx9XZ
PS:
When i use attr on other field ex. text with same procedure class appears properly.
plz help. thx
The text was updated successfully, but these errors were encountered: