text: Q:
  
  How to add a library using Composer?
  
  I don't understand Composer.  I try build own website and I want use material design in Yii2 framework. I find this repository and this repository.
  But I don't understand what this means:
  
  Either run composer global require "romdim/yii2-bootstrap-material:dev-master"
  
  or when I generate new JSON file how to implement it in my project in Yii2.
  Please give me advice step by step.
  ---------------------------------from composer----------------------------------
  https: //i.stack.imgur.com/7kff1.jpg
  
  A:
  
  Composer is a tool for dependency management in PHP.
  What that means is that instead of the need to have all the external code (library, classes, modules, or whatever you want to call) you will have a configuration json file with the path to the repositories that contain this code.
  It is really amazing tools and it is the way to set up any serious php project.
  In order to deploy a project that uses composer you first will need to have php and composer on your computer in order to work.
  Yii2 uses composer to load all the modules so basically with composer you can't do anything at all.
  The first link you show is not a Yii2 project and the second is a Yii2 extension wrapper of your first link.
  The first link is an npm, bower and grunt project and has nothing to do with php or composer.
  What it is telling you the readme of the second link is that if you want to use the bootstrap material design within your Yii2 project need to add the module to the composer.json file that you should have in your yii2 project.
  You can do that running:
  composer global require "romdim/yii2-bootstrap-material:dev-master"
  Or editing the composer.json file yourself and add: 
  "romdim/yii2-bootstrap-material": "dev-master",
  
  Then in your local box you need to run the following command in the same folder that you have composer.json file:
  composer update
  
  This command will download all the repositories listed in the composer.json file and imported into your project at the vendor folder.
  It will also create a composer.lock file that will have all the version releases downloaded from the last time you did composer update. This is useful because when you move your files to the production environment you don't want to download new untested versions and instead you will use:
  composer install
  
  If you only want a simple website with material design and you never used yii2 I won't recommend to use it.
  If you want to learn yii2 as a php framework I do recommend starting from the Yii2 guide
  Or if you are more a video tutorial person:
  https://www.youtube.com/watch?v=z1xtFbO9jgQ
  
  