Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You're right, it is.

The advantage of a router is basically: please always execute this code (auth, db connection, logging, session, rate limiting, csrf protection) before running the actual code for pages that will be rendered.

Or you could also just keep using normal page.php files and possibly include a boot.php at the top of the pages to achieve the same. But then you don't get pretty URLs unless you're doing some server URL rewriting.

Come to think of it, routers require URL rewriting too.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: