如何安装第三方Bundle

##1.安装php

通常经过composer来安装composer require friendsofsymfony/user-bundle具体版本什么的能够参考packagistapp

##2.开启bundle 在app/Appkernel.php中注册该Bundlecomposer

public function registerBundles()
 {
    $bundles = array(
        // ...
        new FOS\UserBundle\FOSUserBundle(),
    );

    // ...
 }

若是想要某些bundle只在特定的环境下开启能够经过一个判断来解决 //dev,test环境下开启 if (in_array($this->getEnvironment(), array('dev', 'test'))) { $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(); }ui

##3.配置Bundlethis

能够经过查看bundle的文档说明来配置;也能够经过一个命令来查看某一个bundle的配置项code

php app/console config:dump-reference AsseticBundle(也能够是root配置项的名称assetic)symfony

相关文章
相关标签/搜索