News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Konrad Podgórski:
A better way to work with assets in Symfony 2
June 25, 2014 @ 13:02:11

Konrad Podgórski has a recent post to his site with his suggestion of a better way to deal with assets in Symfony 2-based applications with the help of some other tools, namely NodeJS, Bower and GruntJS.

I will explain how to work with assets in Symfony framework without having to use Assetic Bundle at all. [...] The process will be really fast and easy to understand even if you never used software listed here. However if you experience any problems do not hesitate to ask for help in comments. Post is quite long because it contain a lot of different configs but don't run away just yet. They are ready to copy & paste.

The setup will download the needed dependencies, merge and minify JS/CSS files, copy font files to the right place and deploy it all to an S3 bucket. He first walks you through the installation of the three tools complete with the commands and configurations to get them all integrated. With those installed and working, he then gets into three "scenarios", the steps in the process to build and deploy the completed version:

  • Download latest jQuery, Bootstrap, Font Awesome with Bower and copy the only necessary files to web/assets/*
  • Download dependencies with Bower, copy necessary files to web/assets/*. Then minify javascript and stylesheet files.
  • Download dependencies with Bower, merge them with your custom css and js files, then minify.

Finally, he includes the steps you'll need to follow to get the whole thing deployed out to S3 (or a CDN). In the next part of the series he'll continue the process and look at things like LESS/SASS, watching for changes in assets and how to use RequireJs.

0 comments voice your opinion now!
assets symfony2 grunt bower nodejs tutorial install configure deploy

Link: http://konradpodgorski.com/blog/2014/06/23/better-way-to-work-with-assets-in-symfony-2/

blog comments powered by Disqus

Similar Posts

HowTo Forge: Installing Lighttpd With PHP5 And MySQL Support On Fedora 7

Wojciech Sznapka's Blog: Loosening dependencies with closures in PHP

Aaron Pollock: Setting up a PHP development environment on a VPS

Sameer Borate's Blog: Building a Graph data structure in PHP

Lorna Mitchell's Blog: PHP 5.4 Built In Webserver


Community Events





Don't see your event here?
Let us know!


api bugfix conference framework tips community laravel release language introduction list interview zendserver developer symfony deployment voicesoftheelephpant library podcast series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework