How to install or integrate bundles in Symfony2

后端 未结 2 1651
执念已碎
执念已碎 2020-12-20 08:00

i have downloaded a sonata admin bundle, and have placed in /var/www/Symfony/vendor/symfony/src/Symfony/Bundle, and have made an entry in AppKernel.php

2条回答
  •  执念已碎
    2020-12-20 08:31

    You need to move the bundle to

    /var/www/Symfony/vendor/bundles
    

    Then in AppKernel.php add

    new Sonata\AdminBundle\SonataAdminBundle(),
    

    in your $bundles array.

    In autoload.php add

    'Sonata'           => __DIR__.'/../vendor/bundles',
    

    to the $loader->registerNamespaces array

提交回复
热议问题