Archive for June, 2011

Symfony2: Assetic Twig Functions

In my post Symfony2: Using Assetic for Image Optimisation I looked at using Assetic for image optimisation. In that I looked at OptiPNG set up like this in the config: assetic: filters: optipng: bin: /path/to/optipng and using a Twig template that looks like this: {% image output="/images/test.png" ‘@LimeThinkingSpringBundle/Resources/images/test.png’ %} <img src="{{ asset_url }}" alt="The alt [...]

Symfony2: Moving Away From the Base Controller

When you start learning Symfony2 using the book, you are introduced to the base controller. The base controller has some helpful methods to make common tasks easier. After a while though you may want to move away from extending this controller, in fact, it is the advised best practice for controllers in shared bundles. When [...]

In Defence of Dependency Injection Containers

There has been some criticism recently of the use of Dependency Injection Containers (DICs) with a lot of people saying that DI != DICs. For example see http://till.klampaeckel.de/blog/archives/154-Dependency-Injection-Containers.html and the comments on it. Whilst I agree with that DI !+ DICs, I do not agree with it being turned into DI good, DICs bad. In [...]

Symfony2: A Few Assetic Notes

Just a quick post with a few notes on Assetic. These are mainly on topics people have been searching for when they have visited this blog. Loading Filters If you are using Assetic from Symfony2 then its worth being aware that it does not automatically load up all the available filters. Only the filters you [...]

Symfony2: Writing a Dependency Injection Extension Configuration

In this post I will look at how to write a more sophisticated Dependency Injection Extension for your Symfony2 bundles. Bundle Level Config In my earlier post Symfony2: Controller as Service I looked at creating a very basic extension that would allow us to load an XML file defining the services. The class looked like [...]

Subscribe to RSS Feed Follow me on Twitter!