我想使用parameters.yml
作为参数,但是顶级名称就像数据而不是参数。为此我做了以下事情:
在根目录的composer.json
中:
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters":
{
"file": "app/config/parameters.yml",
"parameter-key": "data"
}
}
在parameters.yml
和parmeters.yml.dist
这样:
data:
database_driver: pdo_mysql
但是当我运行命令php composer.phar update时,我收到一个错误:
[Symfony\Component\Config\Exception\FileLoaderLoadException]
Cannot import resource "D:\xampp\htdocs\symfony_two\app/config\parameters.y
ml" from "D:\xampp\htdocs\symfony_two\app/config\config.yml". (There is no
extension able to load the configuration for "data" (in D:\xampp\htdocs\s
ymfony_two\app/config\parameters.yml). Looked for namespace "config", found
"framework", "security", "twig", "monolog", "swiftmailer", "assetic", "doc
trine", "sensio_framework_extra", "forma_test", "custom_customer", "acme_de
mo", "web_profiler", "sensio_distribution")
我没有得到。我错过了在某处定义数据的东西吗?