Hook into before form schema
We have a form field that we want in 90% of all forms. Instead of manually having to add this to all form schemas I would like to find an automatic way to do this based on a certain condition. What would be the best way to achieve this?
Have tried by extending classes etc but can't find a good solution to hook into the form schema and add fields in a parent class or so. Is there any other way we can hook in at the beginning or end of form schema? Or any other good solution that is SOLID?
Any help is highly appreciated.
3 Replies
defined a class that return the fields in array
then include it in your form schema
That's definitely a solution. I was just looking at a more clean solution where you don't always have to remember to include this.
If there is a way for you to define once and forget it, then you always have to remember to exclude it when you don’t need it