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 [...]
Posts Tagged ‘assetic’
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: Using Assetic for Image Optimisation
Symfony2 uses Assetic for asset management, I have previously written about its use for JavaScript and CSS files. In this post I am going to look at another of its uses, optimising images. Amongst its many filters, Assetic currently has four which can be used for on-the-fly image optimisation. This way you can get the [...]
Symfony2: Make your own Assetic Filter
Symfony2 uses Assetic as its asset manager, it provides many excellent filters for processing CSS, JavaScript and Image files. You may find though that the existing filters do not perform a task you need. Thanks to the excellent Dependency Injection in Symfony2 it is easy to write your own filter and put it to use [...]
Symfony2: Using CoffeeScript with Assetic
CoffeeScript is a scripting language which is compiled to run as JavaScript. It let you write simpler code with improvements in much of the JavaScript syntax, mainly inspired by Ruby and Python. It is served up to the end user as JavaScript so it requires nothing on the end users part. If you are using [...]
Symfony2: Using Assetic from Twig
After my earlier post digging in to how Assetic (Symfony2‘s asset manager) works, I am now going to look at how you should actually use it from Symfony2′s templating engine Twig. Kris Wallsmith the developer of Assetic pointed me in the right direction in the comments on that post. He has now added some official [...]
Symfony2: Using Assetic for CSS and JavaScript Management
Edit: Please read the first the first comment from Kris Wallsmith, this explains that you do not need to write any PHP at all to make use of Assetic, it can be configured directly from Twig templates. My follow up post Symfony2: Using Assetic from Twig has more on this. Nevertheless the following should give [...]


