We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Cyclic routing - seeing route history

I'm currently experiencing a "cyclic routing" issue. However, the exception thrown is pretty useless, as I have no idea what routes are being matched.

Phalcon is obviously keeping track of which routes it's routing to - is there any way to see that history? I really have no clue what routes are being cycled between, and seeing the history would really be helpful.

Hi Dylan do you try with add some events and check this? I check the router.zep code and found this 6 events

None of the events can stop the operation.

Event Description
router:beforeCheckRoutes Fired before check all loaded routes
router:beforeCheckRoute Fired before check a route
router:matchedRoute Fired when a route is matched
router:notMatchedRoute Fired is any route is matched
router:afterCheckRoutes Fired after check all routes
router:beforeMount Fired before mount a new route

I tied into dispatch:beforeException and logged the error to a file. That pointed me in the right direction.