Install third-party bundles
1, install with composer
Composer require friendsofsymfony/user-bundle= "composer require bundelname
How did Bundlename get here: A, the project's Readme file B, Find packagist.org on the website
Search for some third-party bundle packagist.org
The above command will select the most appropriate version for your project, if you need to make a version use command
"~2.0"
, command execution is complete, add content to
composer.json , and download the code to the vendor directory.
2, register in Appkernel
Public function Registerbundles (){$bundles=array(//... New Fos\userbundle\fosuserbundle (), ); // ... }
If you want to use bundles only in development mode or test mode, register as follows
class Appkernel extends Kernel {// ... Public function Registerbundles (){$bundles=array(//... ); if (in_array($this,getenvironment(), Array(' dev ',' test ')){ $bundles[]=newdoctrine\bundle\fixturesbundle\ Doctrinefixturesbundle(); }// ... }}
3, configuring Bundles
Configure in this file app/config/config.yml
Config:dump-reference Asseticbundle
The above command can display the manual for the Asseticbundle Configuration (reference)
The above describes the Symfony study note-bundle1, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.