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

Difference between Router and Dispatcher setDefault* functions?

What is the difference between the Router's and Dispatcher's setDefault* functions?

Both the Router class and Dispatcher class have setDefaultNamespace, setDefaultModule, setDefaultController, setDefaultAction, and setDefaulParams, and I was hoping someone could explain why and/or what the difference is.

Basically route can be added without controller/action/namespace parameter. If correct path will be hidden then it will be handled by dispatcher on dispatch level and he will use those default namespace/action/controller.

In router default namespace/module/controller/action can be used to just make this earlier.

Why this option ? I guess this is because you have seperated dispatchers per module i guess.