Hi All,
This is something I have been trying to work out for some time and am still finding it a bit difficult to unpick.
I get the basic concept, you have a controller ($controller) and you then add a handleRequest method to that controller and then handleRequest is called when the controller is matched by a route.
As far as I am aware, if I want to then use another controller to handle a URL I then pass the request to the new controller using handlleRequest() on that controller?
Is that the case? If so, are there any docs on how to do this propperly? If not, is this how I would go about handing over a request to another controller?
The use case I have currently is as follows:
I have "Payment_Controller", this is responsible for sending users to and recieving data from Payment Gateways (such as Paypal, WorldPay, Stripe, etc).
If I want to add a new payment gateway, I add a new controller that extends an abstract controller (called PaymentHandler).
When the URL "/payment/index/paypal" or "/payment/callback/paypal" is called, I want Payment_Controller to automatically hand over control to the PayPal controller. Then I will be free to impliment whatever code I want inside Paypal_Controller such as redirect the user, return a template (or anything else I would do with a controller).
Anyone got and advice on how to do this? Is handleRequest() the right way to go?
Cheers,
Mo