Page 1 of 1

Routing (or maybe not)

Posted: Mon Jun 10, 2019 8:52 am
by david63
I may be trying to do something that is not possible here.

I am revisiting some of my extensions with a view to "tidying" them up a bit and with that in mind I have found that I have a lot of processing in a listener file which I think would be better in a controller. My question is - how do I get an event in a listener to trigger a route to the controller?

Re: Routing (or maybe not)

Posted: Mon Jun 10, 2019 8:55 am
by Senky
Just call the controller directly. Load the controller object using DI container and call the same method that routing is calling.

Re: Routing (or maybe not)

Posted: Mon Jun 10, 2019 9:02 am
by david63
Senky wrote:
Mon Jun 10, 2019 8:55 am
Just call the controller directly. Load the controller object using DI container and call the same method that routing is calling.
Not quite sure I am following that - any chance of an example?

Re: Routing (or maybe not)

Posted: Mon Jun 10, 2019 9:24 am
by david63
It's OK - the brain just fell into gear.