首页 > 解决方案 > Sylius 覆盖安全控制器

问题描述

我在中找到 SecurityController "vendor\sylius\sylius\src\Sylius\Bundle\UiBundle\Controller\SecurityController.php" ,不,我将其覆盖"src\AppBundle\Controller\Ui"并在 app\config\services.yml 中定义:

services:
   sylius.controller.security:
        class: AppBundle\Controller\Ui\SecurityController

现在,我收到此错误:

(2/2) FileLoaderLoadException 导入服务时,预计在文件“/home/ftdev/host/shopex/b2c/unicef/src/AppBundle/Controller/Ui/SecurityController.php”中找到类“AppBundle\Controller\Ui\SecurityController”来自资源“../../src/AppBundle/*”,但没有找到!检查与 /home/ftdev/host/shopex/b2c/unicef/app/config/services.yml 中的资源一起使用的命名空间前缀(从“/home/ftdev/host/shopex/b2c/unicef/app”导入/config/config.yml”)。

标签: overwritesylius

解决方案


如果没有相同的行,请尝试添加到 config/services.yml:

services:
    App\Controller\:
        resource: '../src/Controller'
        tags: ['controller.service_arguments']

推荐阅读