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

Strange behaviour of router

Hi,

I'm trying to use router from Phalcon\Mvc\Micro object like that:

https://pastebin.com/w7v7LhZq

but for valid request I'm getting following exception:

Uncaught exception 'Phalcon\Mvc\Micro\Exception' with message 'Matched route doesn't have an associate handler'

What am I doing wrong? Can anybody help me with this one?

Thanks in advance,

Kamil



98.9k
Accepted
answer

The router is internally reset by Phalcon\Mvc\Micro, if you want to use controllers, you can use 'collections': https://docs.phalcon.io/en/latest/reference/micro.html#using-controllers-as-handlers

Works like a charm. Thanks