Closed dmitryuk closed 2 years ago
In your example show_filter and field_type are sonata options but choices is a symfony option.
For FieldDescription, there is a lot of different types and each has his own constantes, that would make not sens to add them generically here.
For filters, we might introduce constants in https://github.com/sonata-project/SonataAdminBundle/blob/4.x/src/Filter/Filter.php and custom options in each filters https://github.com/sonata-project/SonataDoctrineORMAdminBundle/blob/4.x/src/Filter/StringFilter.php#L120-L123
but it would be weird having constants for some options (like filters) and not others.
Symfony doesn't use constant for options key, and it's worked for years without any issues https://symfony.com/doc/current/reference/forms/types/choice.html#field-options So I don't think it will be really useful
Form types has a lot of options (
required
,help
,field_type
,label
, ...), which not set as constants, but strings. So any developer should remember these, do typos and so on. I think it will better to create storage for constants For example as a result,What do you think? What class to use for purpose?