What is the best way of calling an action of another controller?
I am thinking in different options:
- Using forward plugin
- Setting the second controller as a dependency in the first controller
I think the first option will work but I would like to know if the second one has sense. In that case,
- How can I get the controller dependency?
I have tried to get it using the Service Manager but it isn't there. I have tried creating a Factory for the controller and get the another controller from the Controller Manager which is passed as an argument to the createService method when you implement the FactoryInterface. But it says that no controller is there. Exists a different locator from controllers than can be used in the same way as the Service Locator?
- The controller which has the role of dependency and will be called has to extends or implements any particular class or interface?