Blog

On URL routing, actions and ID parameters

2007-08-29 15:12:26 by Martynas Jusevičius

Many Web frameworks these days (e. g. Symfony, which is one of the more popular ones) are listing URL routing (sometimes also called mapping) as an important feature. Routing basically rewrites URLs with parameters into more user-friendly URLs, most likely hierarchical ones. For example:

http://www.example.com/index.php?category=2&page_id=3&action=view

after routing might become:

http://www.example.com/news/today

Symfony uses a special routing.yml configuration file, a PHP layer and also Apache's URL rewriting behind it to implement routing.

With the DIY Framework, URL routing as in Symfony is simply not necessary. It works another way:

That said, there is no need for some proprietary routing configuration and also no performance cost from the routing layer. Moreover, there are by design no potential security breaches such as passing wrong IDs. Symfony instead tries to cover them with URL routing.

Digg Digg this! del.icio.us del.icio.us!

New comment






No HTML allowed.