A Peak at the Flexibility of the new Symfony 1.2 Routing System

Posted by ryan in routing, symfony

Did you see what happened to the markets today? The whole world is ending.
Jobeet to the rescue???

In December, just as the world economy was falling apart and everyone was being laid off, Symfony released Jobeet, a set of 24 tutorials building a job board around Symfony 1.2. This replaced the long outdated Askeet, which was created for Symfony 1.0 then used far beyond its time.

The routing system was completely reworked to be made awesome in Symfony 1.2. As to be expected, everything is backwards compatible, making it easy for slow-goers like me to ignore all of the new features. Fortunately, Kris Wallsmith has caught my interest with a new article about using the new routing system to route by subdomain. You can find it here:

This particular problem was formerly solved in day of the Askeet tutorial. In that solution, a filter is used to parse the host and use that information.In Symfony 1.2, you can solve this same problem directly using the routing system itself. Check it out - it's also a great way to get your feet wet with what the new routing system can do. Go Symfony.

UPDATE The two topics referenced above (one in Askeet and the other in Kris's article) don't actually quite cover the same topic. The new article explains how to match a url based on a specific subdomain. It does not, however, allow you to match dynamic subdomains and use that subdomain as a parameter in your app (see the article's comments).

Thanks for the shares!
  • StumbleUpon
  • Sphinn
  • del.icio.us
  • Facebook
  • TwitThis
  • Google
  • Reddit
  • Digg
  • MisterWong
Posted by Tal Ater on 2009-05-03
I actually created a plugin called sfDomainRoutePlugin which lets you do that and more.

Check it out at http://www.symfony-project.org/plugins/sfDomainRoutePlugin and if you have any feedback, suggestions, or questions I'd be happy to hear them!