8000 [Form] Radio choice form builder does not render attr · Issue #8269 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[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

Closed
sargath opened this issue Jun 13, 2013 · 7 comments
Closed

[Form] Radio choice form builder does not render attr #8269

sargath opened this issue Jun 13, 2013 · 7 comments
Labels

Comments

@sargath
Copy link
sargath commented Jun 13, 2013

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

@hacfi
Copy link
Contributor
hacfi commented Jun 17, 2013

@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>

@sargath
Copy link
Author
sargath commented Jun 17, 2013

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 ?

@sargath
Copy link
Author
sargath commented Jun 17, 2013

My real class for this is: http://pastebin.com/e7nrppct
and i got same problem for this...

@hacfi
Copy link
Contributor
hacfi commented Jun 17, 2013

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.

@sargath
Copy link
Author
sargath commented Jun 17, 2013

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 ?

@hacfi
Copy link
Contributor
hacfi commented Jun 17, 2013

@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

@sargath
Copy link
Author
sargath commented Jun 17, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0