我有一个使用 symfony 3.4 的应用程序,我正在将其更新为 flex,然后转到版本 4。问题是我有很多捆绑包,而在 FLEX 中它们不适用于这些……所以我正在寻找一种方法维护我的包裹...
这是我的 SRC 文件夹中的内容(控制器、实体和存储库为空):
> SRC
> CONTROLLER
> ENTITY
> REPOSITORY
> Kernel.php
> .htaccess
> H360 (the place of my bundles)
> comercialBundle
> jasperBundle
> generalBundle
> ...
这是它返回给我的错误消息:
In FileLoader.php line 168:
Expected to find class "App\H360\JasperBundle\Controller\DefaultController" in file "C:\inetpub\wwwroot\360forhotels\src/H360\JasperBundle\Controller\DefaultController.php" while importing services from resource "../src/*", but it was not found! Check the name
space prefix used with the resource in C:\inetpub\wwwroot\360forhotels\config/services.yaml (which is loaded in resource "C:\inetpub\wwwroot\360forhotels\config/services.yaml").
In FileLoader.php line 157:
Expected to find class "App\H360\JasperBundle\Controller\DefaultController" in file "C:\inetpub\wwwroot\360forhotels\src/H360\JasperBundle\Controller\DefaultController.php" while importing services from resource "../src/*", but it was not found! Check the name
space prefix used with the resource.
所以这是我的“services.yaml”文件的一部分(我知道这是不对的):
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller'
tags: ['controller.service_arguments']