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 would like to know if it is possible to disable a field of the form if not in a specific shop context.
The traditional behaviour is that by default, when multistore_configuration_key is defined in the options array of the FormBuilder add() method, the value of the field can be defined for all shops, overriden for a specific group of shop or for a specific shop.
I would like to be able to disable the field when in all shops or group of shops context to force the user to select a specific shop to be able to fill out the form field.
The purpose is to store a configuration value that is specific to a shop and that should not be allowed to be defined for a group of shops or all shops context.
How can I retreive the current context from within the buildForm() method of a class that extends CommonAbstractType ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello 👋,
I have read Configuration forms in multistore context documentation page and experimented with the
demomultistoreform
example module.I would like to know if it is possible to disable a field of the form if not in a specific shop context.
The traditional behaviour is that by default, when
multistore_configuration_key
is defined in theoptions
array of the FormBuilder add() method, the value of the field can be defined for all shops, overriden for a specific group of shop or for a specific shop.I would like to be able to disable the field when in all shops or group of shops context to force the user to select a specific shop to be able to fill out the form field.
The purpose is to store a configuration value that is specific to a shop and that should not be allowed to be defined for a group of shops or all shops context.
How can I retreive the current context from within the
buildForm()
method of a class that extends CommonAbstractType ?Thanks for your help 🙏
Beta Was this translation helpful? Give feedback.
All reactions