Re:Toro - a php micro-router with great examples
by jakejake on Thursday August 23, 2012 @04:41PM
(#4424721)
If anything I find that a router makes your code easier to test. If you're 100% consistent about using the router to obtain user input, then your code is easy to unit test with a mock router. Routers themselves can be easy to test as well.
It's a clean separation of concerns - the router is the only thing that knows about the URL implementation. The rest of the code relies on the router to do that. That's a good practice to me.
What would you would consider "best practice" in place of a router?
It's a clean separation of concerns - the router is the only thing that knows about the URL implementation. The rest of the code relies on the router to do that. That's a good practice to me.
What would you would consider "best practice" in place of a router?