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

How to match the route to the subdirectory of the controller

I would like to classify inside the controller, create a new subdirectory. But there is no way to match this route, the following is my solution

My solution is to register multiple namespaces and then route them to match the corresponding namespace, but does this need to register multiple namespaces, is there a better way?

I think the solution with multiple namespaces is the way to go. This is a good example of "subcontrollers": https://github.com/phalcon/mvc/tree/master/simple-subcontrollers