Symfony2正在调用未知捆绑包

时间:2016-06-21 09:06:48

标签: php symfony

我使用composer
安装了一个新的包 php bin/console generate:bundle我将其命名为TestBundle(只是为了熟悉这些命令),之后我按照以下步骤将其删除:

  1. 从AppKernel.php
  2. 中删除它
  3. 从app / config / routing.yml
  4. 中删除它的路线
  5. 最后我删除了包含捆绑包的相关文件夹
  6. 现在,每次打开我的应用程序时,symfony都会显示此错误:

    Bundle "TestBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file? in @TestBundle/Resources/config/services.yml (which is being imported from "C:\wamp\www\symfony1\app/config\config.yml"). Make sure the "TestBundle/Resources/config/services.yml" bundle is correctly registered and loaded in the application kernel class. If the bundle is registered, make sure the bundle path "@TestBundle/Resources/config/services.yml" is not empty.
    

    symfony如何不断地告诉我关于不存在的捆绑包的错误?!

1 个答案:

答案 0 :(得分:0)

就像@qooplmao所说,当你通过命令行安装一个bundle时,它会将bundle类名添加到AppKernel.php并将值路由到routing.yml除了它导入services.yml之外将新生成的包中的文件发送到config.yml下的全局app/config,您需要删除该导入语句。