The main components are:
- Silex to tie everything together and to provide Twig support.
- gulp.js as a JS build system
- browserify to handle JS components
- AngularJS as a JS Framework (can be easily removed if not needed)
- Less for CSS handling
- Behat configured to use PhantomJS for functional testing
To install, build, and test the project, you will need the following tools:
- A global install of gulp
- PhantomJS (optional)
$ composer create-project monkeycode/microsite-template myProject $ cd myProject $ npm install $ bower install
All non-PHP code is located in
/resources, all PHP files in
/node_modulesbecause of the napa install).
/resources/less: Less files. Already includes imports for Bootstrap v3.
/resources/views: Twig templates.
/src/app.php: Silex application setup.
/src/controllers.php: Controllers & routing.
/config: Silex application configuration.
/web: Document root. Front controllers and generated JS/CSS assets.
The provided basic
gulpfile.js lets you run the following tasks:
Some additional tasks are available, but will generally be called implicitly as dependencies of the two previous tasks:
gulp less: Compile Less to CSS in
gulp js-dev-lib: Concatenate all vendor libraries separately from the application JS for dev use.
gulp js-dev-app: Concatenate all scripts separately from the vendor libraries for dev use.
gulp dev: Runs
A sample test is provided in Behat, and configured for use with PhantomJS.
The suite can be run locally by calling