Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

routing

which one is better in phalcon ? using routing or do not use a routing ?



1.1k
Accepted
answer

There is not a right answer to this unless you consider it limited to a specific project requirements.

There is a cost to using a router, but without one, it's hard to manage a consistent state for your app across multiple end-points, this is why front-controller pattern was created, to have a single point of entry for dynamic requests.

If you don't use routing at all you'll have to manage multiple files to deal with endpoints, and I don't think you can handle restful requests easily.

If you do use routing there is obviously a cost to register routes, to have the expressive and easily readable syntax phalcon provides.

Phalcon is really fast! The cost of routing is incredibly low compared to a laravel project, probably even compared to something like WordPress, which does not have a single front-controller.

Use routing ofcourse. It's much easier and cleaner to maintain your app.