Fabien's Approach to Cross Application Links

Posted by ryan in php, symfony

I just saw on twitter that Fabien has posted a nice article on how to create links between your Symfony applications (i.e. cross-application linking).

Symfony - Cross Application Links (http://www.symfony-project.org/blog...application-links)

Fabien's method, while it has one small limitation, is faster than the existing method and it's always nice to see how the man behind the curtain solves common problems. As discussed in the comments already, there are 2 points to realize:

  • This method won't work for any routes connected via the application's routing.load_configuration event. This is a common method for introducing routing in plugins
  • The current method creates a new sfContext instance for the target application. While this method will correctly handle ALL routes, creating the extra context instance is somewhat "heavier" than simply reading in the routing.yml configuration file.

Unless you have some special need, Fabien recommends taking the simple route (no pun intended) and I happily agree.

Thanks for the shares!
  • StumbleUpon
  • Sphinn
  • del.icio.us
  • Facebook
  • TwitThis
  • Google
  • Reddit
  • Digg
  • MisterWong