Symfony Study Notes-bundle1

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.