Including basics using composer

I'm trying to learn a composer, now I want to include a (zurb) base, so I added "require": {"zurb / foundation": "v5.2.2"} to the composer.json file. After completing the composer.phar update, I see that files have been added to the / vendor / zurb / foundation folder.

But I have no idea how to proceed, can someone please advise how I can start creating my web application now? How to make it use the css and js files needed to create?

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

I have already created several websites and applications using the basics, but always "manually" and then just add the right css and js files to the page header and footer. Now I just don’t know where to start.

thank you for your help.

+4
source share
1 answer

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 these steps:

  • Install Bower with sh $ npm install -g bower(you will need Node.js and npm )
  • Bower ( Bower docs )

    {
      "name": "MyProject",
      "dependencies": {
        "foundation": "*"
      }
    }
    
  • Bower to Composer composer.json

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

, composer update ( install), bower !

+2

Source: https://habr.com/ru/post/1536954/


All Articles