This is more of a curiosity than a "need".
I have a few controller actions that do exactly the same thing, just some parameters differ.
I'm trying to reduce the amount of code I write and have one single controller class and via
di.xml configure that class using virtual types.
I know I can just create empty classes for each controller that extend a main controller action and configure them via di.xml, but I want to skip those too if possible.
I got from here that virtual types can be used as source models because they are instantiated via object manager.
Controllers are also instantiated via Object Manager, but I think things happen a little different.
I'm expecting an answer like:
- this is not possible because...
- yes, it's possible, here is how you can do it...
- not sure it is possible but here is how you can test....