• 04.12.11 - Minify CSS and JS files with Assetic and Symfony2

    Unify all our CSS and JS stuff into unique minified files improves significantly your application performance.Thanks to the Assetic Symfony2 bundle you can do it on the fly.First, , unzip it and move the "yuicompressor-*.jar" to the "app/Resources/java" folder.Connect Assetic with the compressor [...]
    More news about:  Symfony2
    Tags:  php,  css,  javascript,  Twig,  Symfony2,  Assetic,  YUI compressor,  minify
  • 02.10.11 - i18n in Twig extensions with Symfony 2

    First of all we have to connect our Twig extension with the translation service. We have to configure the dependency injection container to do that.Prepare the dependency injection container to load the configuration from an XML file Connect the Twig extension engine with the translator service [...]
    More news about:  Symfony2
    Tags:  Twig,  Extension,  i18n,  Inyector de dependencias
  • 15.08.11 - Extending Twig in Symfony 2, add custom functions

    Sometimes we need to add some custom functions to the view. In Symfony 1 we have the helpers, in Symfony 2 we must extend Twig in order to add it.At first, we have to connect our future Twig extension to the Dependency Injection Container in our Bundle. If we don't got any config file we have to [...]
    More news about:  php,  Symfony2
    Tags:  php,  Twig,  Extension,  Kernel,  Bundle