5

I try to learn composer, now I want to include (zurb) foundation, so I added "require": {"zurb/foundation": "v5.2.2"} to the composer.json file. After running composer.phar update, I can see that there are some files added to the folder /vendor/zurb/foundation.

But I have no clue how to continue, could anybody please advise how I can start building my web-app now? How do I get it to use the css and js files that are needed for foundation?

I already included the file vendor/autoload.php to my index.php, but that doesn't seem to be enough.

I already built multiple web-sites and apps using foundation, but always "manual", then I just include the right css and js files to the header and footer of the page. Now I just don't know where to start.

thanks for your help.

3
  • 1
    Composer is for PHP packages. Front-end packages should be included using Bower (the package manager for font-end packages). You can also take a look at the component installer if you don't want to use bower Commented Apr 17, 2014 at 21:58
  • 1
    Thanks for your comment, but why is it then available via composer when that doesn't do anything? or am I seeing it wrong? Commented Apr 18, 2014 at 22:41
  • 3
    because some people thought Composer was the answer to everything... :) Commented Apr 19, 2014 at 10:07

1 Answer 1

3

Check this question first to get the basics: NPM/Bower/Composer - differences?.


Then, if you decide to go with Composer for PHP and Bower for front-end libraries, follow this:

  1. Install Bower using sh $ npm install -g bower (you'll need Node.js and npm first)
  2. Configure Bower for you front-end packages (visit Bower docs for more information)

    { "name": "MyProject", "dependencies": { "foundation": "*" } } 
  3. Hook Bower to Composer adding this to your composer.json

    "scripts": { "post-install-cmd": [ "bower install" ], "post-update-cmd": [ "bower install" ], } 

Now every time you hit composer update (or install), bower components get updated as well!

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.