You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case where putting the choices for a setting in the configuration files is not naturel.
I have content stored in a database and users can select some items from this content and put it
in their preferences.
The form type class Dmishh\Bundle\SettingsBundle\Form\Type/SettingsType builds choices from the configuration and I think it does not allow to provide choices from another source.
By design the Symfont Form Component does not allow to change form options after it has been built.
Letting dev provide the choices from another source would add more flexibilite and allow building more complex settings.
What about doing it using Symfony Event dispatcher ?
The text was updated successfully, but these errors were encountered:
I am thinking of creating a tag to handle event listener services. An event will be fired for each field options before building the form field.
In the meantime a have changed the SettingsType class to call call a method that provides the options.
This allows child classes to provide the extra options. See feature-custom-form-options
This is enough for my use case. If there is a more global need for this kind of behaviour I will submit a PR for the event listeners.
I can envision using this database persistence for user preferences that would exist across sessions. Is there any expectation of a date for a 2.1 release?
I have a use case where putting the choices for a setting in the configuration files is not naturel.
I have content stored in a database and users can select some items from this content and put it
in their preferences.
The form type class Dmishh\Bundle\SettingsBundle\Form\Type/SettingsType builds choices from the configuration and I think it does not allow to provide choices from another source.
By design the Symfont Form Component does not allow to change form options after it has been built.
Letting dev provide the choices from another source would add more flexibilite and allow building more complex settings.
What about doing it using Symfony Event dispatcher ?
The text was updated successfully, but these errors were encountered: