AppKernel.php weird behavior

前端 未结 1 1657
醉酒成梦
醉酒成梦 2020-12-19 07:54

So, I am trying to make a new project, but something is happening with kernel, which I don\'t really understand. Every time when I generate new Bundle and try to create Cont

相关标签:
1条回答
  • 2020-12-19 08:05

    Try to change your composer.json file from this:

    "psr-4": {
        "AppBundle\\": "src/AppBundle"
     }
    

    to this:

    "psr-4": {
        "": "src/"
    },
    

    In this way you load all Bundle under src.

    Like this:

    "psr-4": {
        "AppBundle\\": "src/AppBundle",
        "ContactBoxBundle\\": "src/ContactBoxBundle",
    }
    

    Or you can specify every Bundle to load if you want.

    After that you need to make from console:

    composer dump-autoload
    
    0 讨论(0)
提交回复
热议问题