A while ago I had a twitter discussion with Igor Wiedler and Matthias Noback about setter injected dependencies being mutable. When using objects as services in an application then we do not want them to…

  • dependency injection , php , symfony2

In my last post I looked at the end at creating a Twig extension that would return the template to extend in order to pull the logic for the decision out of the template. The…

  • config , dependency injection , php , symfony2 , Twig

In this post I am going to look at some techniques for cleaning up Symfony2 controller actions. Some of this by using some of the extras that are part of the standard distribution and some…

  • dependency injection , doctrine , doctrine2 , php , symfony2

In my previous post I looked at Symfony2 Service Container Compiler Passes, in this post I will look at how to manipulate service container parameters and definitions from within a compiler pass. So the important…

  • dependency injection , php , symfony2

In this post I am going to look at compiler passes. This is not something that you will often need to worry about when making an app with Symfony2. They do come in useful for…

  • dependency injection , php , symfony2

In this quick post I am looking at how to obtain the Request object in a Symfony2 controller as a service. This is actually covered in the docs but in one of the earlier introductory…

  • dependency injection , php , symfony2