Alsatian67 / FormBundle

Bunch of FormTypes extending some basic Symfony PHP framework FormTypes. ExtensibleTypes makes it possible to allow extra choices by Symfony ChoiceTypes (ChoiceType, EntityType and DocumentType). This can help to make it work with the Select2 jQuery pluggin.
MIT License
14 stars 6 forks source link

Clarify something in the documentation, please #25

Closed danbettles closed 2 years ago

danbettles commented 2 years ago

Hello

Thanks very much for the bundle: it's spot on.

Please could you help me with something in the documentation? What does the following mean?

Configuration : Insert %alsatian_form.parameters.extensible_entity.attr_class% as class for the HTML select.

I thought it meant I could do the following.

//...
->add('something', ExtensibleEntityType::class, [
    //...
    'attr' => [
        'class' => 'something %alsatian_form.parameters.extensible_entity.attr_class%',
    ],
])
//...

But that doesn't work.

Could you clarify, please?

Many thanks, Dan

Alsatian67 commented 2 years ago

If you define the parameter %alsatian_form.parameters.extensible_entity.attr_class% "globaly" in the config/ dir, the value of this parameter will be used by each ExtensibleEntity type without other configuration.

If you want to set the class only on thus form, forget this feature and write your desired class directly in 'attr'.