【问题标题】:FOSOAuthServerBundle + Symfony 4 Configuration - can't import routesFOSOAuthServerBundle + Symfony 4 配置 - 无法导入路由
【发布时间】:2018-12-22 14:27:36
【问题描述】:

我正在尝试根据官方文档配置 Bundle,但是当我添加路由时(如文档中所述)

在app/config/routing.yml中导入routing.yml配置文件: fos_oauth_server_token: 资源:“@FOSOAuthServerBundle/Resources/config/routing/token.xml” fos_oauth_server_authorize: 资源:“@FOSOAuthServerBundle/Resources/config/routing/authorize.xml”

我收到一个错误:

没有扩展能够加载“fos_oauth_server_token”的配置(在 /var/app/ondeck/config/packages/routing.yaml 中)。在 /var/app/ondeck/config/packages 中查找命名空间“fos_oauth_server_token”,找到“framework”、“twig”、“security”、“nelmio_cors”、“doctrine_cache”、“doctrine”、“api_platform”、“fos_oauth_server” /routing.yaml(在资源“/var/app/ondeck/config/packages/routing.yaml”中加载)。

有什么想法吗?

【问题讨论】:

    标签: symfony fosoauthserverbundle


    【解决方案1】:

    您将路线导入错误的文件中。

    config/packages/routing.yaml 文件用于路由器配置,而不是用于定义路由。

    您应该有一个config/routes 目录,在此处导入 FOSOAuthServerBundle 路由。

    【讨论】:

    • 是的,你是对的。我在配置过程中犯了一个错误。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-17
    相关资源
    最近更新 更多