I have a configuration form that if it wasn't previousely configured should be the only thing that the user is able to see.
I would like to hijack the response for the current page and display the form, no matter what url the user is currently on. I could do a redirect but I would rather learn how to do it this way.
I presume this is done via EventSubscriber, I'm just not exactly sure how. Do I have to render the form and set is as response? Or can I just alter the controller for active route? Which would seem more DX friendly to me.
*I am not looking for contrib module to do this.
I was looking at the kernel events but the only viable events were
- request - which already had the route "loaded"
- controller - which is fine but in most cases it requires DI stuff so I cannot swap it so easily, and
- response - too late, creating a new repsonse is not good for performance