config.yml中自定义参数的Symfony2配置设置

时间:2014-03-04 09:38:31

标签: symfony

我想使用parameters.yml作为参数,但是顶级名称就像数据而不是参数。为此我做了以下事情:

在根目录的composer.json中:

"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": 
    {
        "file": "app/config/parameters.yml",
        "parameter-key": "data"
    }  
}

parameters.ymlparmeters.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")

我没有得到。我错过了在某处定义数据的东西吗?

0 个答案:

没有答案