gpt4 book ai didi

symfony - 在 symfony2 config.yml 文件中导入 yml 配置

转载 作者:行者123 更新时间:2023-12-02 18:07:17 35 4
gpt4 key购买 nike

在我的 Symfony2 config.yml 文件中,我想导入一些我希望收集在单独的 yml 文件中的配置。

我用过:

imports:
- { resource: parameters.yml }
- { resource: sso_accounts.yml }

在我的 sso_accounts.yml 文件中,我基本上有:

sso_accounts:
company:
publickey: publickey
secret: privatekey
users: [ user1@email.com, user2@email.com ]

但是(总有一个但是...)我收到此错误:

Whoops, looks like something went wrong.

2/2 FileLoaderLoadException: Cannot import resource "/Users/mycomp/Sites/myapp/app/config/sso_accounts.yml" from "/Users/mycomp/Sites/myapp/app/config/config.yml".

1/2 InvalidArgumentException: There is no extension able to load the configuration for "sso_accounts" (in /Users/mycomp/Sites/myapp/app/config/sso_accounts.yml). Looked for namespace "sso_accounts", found "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "assetic", "sensio_framework_extra", "jms_security_extra", "problematic_acl_manager", "twig_js", "fos_js_routing"

我的导入出了什么问题?

最佳答案

config.yml 中的配置由扩展加载。您的 sso_accounts 有一个吗?看来你还没有。

您可以在此处阅读其工作原理: http://symfony.com/doc/current/cookbook/bundles/extension.html

关于symfony - 在 symfony2 config.yml 文件中导入 yml 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10224967/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com