Routing (or maybe not)

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
david63
Registered User
Posts: 16545
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Routing (or maybe not)

Post by david63 » Mon Jun 10, 2019 8:52 am

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?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

Senky
Extension Customisations
Extension Customisations
Posts: 2146
Joined: Thu Apr 30, 2009 8:49 pm
Name: Jakub
Contact:

Re: Routing (or maybe not)

Post by Senky » 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.

User avatar
david63
Registered User
Posts: 16545
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Routing (or maybe not)

Post by david63 » Mon Jun 10, 2019 9:02 am

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?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
david63
Registered User
Posts: 16545
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Routing (or maybe not)

Post by david63 » Mon Jun 10, 2019 9:24 am

It's OK - the brain just fell into gear.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

Post Reply

Return to “Extension Writers Discussion”