如何安裝第三方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

相關文章
相關標籤/搜索