This tutorial has a new version, check it out!

Starting in Symfony2: Course 4 (2.4+)


What you'll be learning

// composer.json
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "~2.4", // v2.4.2
        "doctrine/orm": "~2.2,>=2.2.3", // v2.4.2
        "doctrine/doctrine-bundle": "~1.2", // v1.2.0
        "twig/extensions": "~1.0", // v1.0.1
        "symfony/assetic-bundle": "~2.3", // v2.3.0
        "symfony/swiftmailer-bundle": "~2.3", // v2.3.5
        "symfony/monolog-bundle": "~2.4", // v2.5.0
        "sensio/distribution-bundle": "~2.3", // v2.3.4
        "sensio/framework-extra-bundle": "~3.0", // v3.0.0
        "sensio/generator-bundle": "~2.3", // v2.3.4
        "incenteev/composer-parameter-handler": "~2.0", // v2.1.0
        "doctrine/doctrine-fixtures-bundle": "~2.2.0", // v2.2.0
        "ircmaxell/password-compat": "~1.0.3", // 1.0.3
        "phpunit/phpunit": "~4.1", // 4.1.0
        "stof/doctrine-extensions-bundle": "~1.1.0" // v1.1.0

Welcome back for part 4 of our Starting in Symfony2 series! We've got some really important topics planned and we're going to start with mastering assets and the Assetic library. We'll bust cache, minimize our CSS & JS files and get you ready to do just about anything with your static assets. We'll also dive much deeper into form rendering - customizing our forms to work with Twitter Bootstrap and learning a lot more about the powerful and advanced mechanisms behind form theming. Finally, we'll cover deployment: what steps are always necessary and some options for automating the process. Let's do this!


  • The Twig asset function
  • More about Dependency Injection Parameters and the purpose of parameters.yml
  • Cache busting with assets_version and assets_version_format
  • Introduction to Assetic
  • Assetic filters, including cssrewrite, cssmin and the apply_to option
  • Dumping assets in the prod and dev environments and the secret of turning use_controllers to false
  • The basics of form customization and theming
  • FormView "variables" - what they are and how you can use them to do just about anything while customizing how a form renders
  • Using the finishView to control FormView "variables"
  • The steps and best practices for deployment with tips on automating the process

Your Guides

Ryan Weaver Leanna Pelham

Buy Access

Questions? Conversation?