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

Skip to content

[Form] Unable to customize the attributes of all <option> generated by entity type #9289

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
jean-pasqualini opened this issue Oct 14, 2013 · 5 comments
Labels

Comments

@jean-pasqualini
Copy link
Contributor

I currently use due to meet this challenge.

Eg.

        $builder->addEventListener(FormEvents::POST_SET_DATA, function(FormEvent $event)
        {
            $data = $event->getData();
            $form = $event->getForm();

            $formDisponibility = $form->get("disponibility");

            $choiceListOption  = $form->get("disponibility")->getConfig()->getOption("choice_list");

            $choices = $choiceListOption->getChoices();

            $views = $choiceListOption->getRemainingViews();

            foreach($choices as $key => $choice)
            {
                $view = $views[$key];

                $view->attr = array("data-day" => $choice->getDay());
            }

        });
@jean-pasqualini
Copy link
Contributor Author

Please read my issue, thank

@cordoval
Copy link
Contributor

cordoval commented Dec 2, 2013

is this a limitation or is just missing documentation? ping @bschussek

@cordoval
Copy link
Contributor

@oneTest are you trying to customize the form themes? could you please fork Symfony Standard Edition and push a branch there exhibiting this problem/limitation. Is it possible to do the same via a custom theme?

👶

@CSchulz
Copy link

CSchulz commented Sep 22, 2014

@cordoval It is more than just a custom theme. The ChoiceView needs to get a new field holding the attributes.

@jakzal
Copy link
Contributor

jakzal commented Sep 22, 2014

duplicate of #3836

@jakzal jakzal closed this as completed Sep 22, 2014
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

4 participants