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

Symfony Finland:
A simple front end workflow for Symfony and Foundation frameworks
Mar 07, 2016 @ 10:52:08

The Symfony Finland blog has posted a guide with a simple frontend workflow for those working in Symfony-based applications. He shows how to easily integrate and work with Gulp from inside of your application with relative ease.

In Symfony 2.7 the team introduced the asset component. It allows for a standard method for linking to front end assets in your bundles, but has no say in how assets are built. It is agnostic to whether assets are built with Gulp, Grunt, Webpack or some other tool.

[...] All files placed in the Resources/public -directory within a bundle is made available to the web server using a Symfony Command for assets install. Since Symfony 2.6 it has featured symlinking to the real asset directories, making the requirement to run the command limited to the times you add new bundles.

He shows how to use the assets component and its related commands to set up the symlink for a new bundle. He then helps you get the foundation command line tool installed and create a simple Gulp configuration file to build out your SASS files and compile them. From there using the setup is as easy as adding a tag to the Twig template, making a call to the asset method and pointing to the required resulting CSS file from the compile.

tagged: frontend workflow symfony foundation tutorial setup gulp

Link: https://www.symfony.fi/entry/a-simple-front-end-workflow-for-symfony-and-foundation-frameworks