Symfony2参数和子参数

时间:2015-11-13 11:12:55

标签: php symfony

我正在尝试以这种方式配置我的应用: parameters.yml:

# This file is auto-generated during the composer install
parameters:
    database_host: 127.0.0.1
    database_port: null
    database_name: db_prod
    database_user: root
    database_password: pass
    testing:
        database_host: 127.0.0.1
        database_port: null
        database_name: db_test
        database_user: root
        database_password: pass

并在config_test.yml中我有:

doctrine:
    dbal:
        driver:   pdo_mysql
        host:     "%testing.database_host%"
        port:     "%testing.database_port%"
        dbname:   "%testing.database_name%"
        user:     "%testing.database_user%"
        password: "%testing.database_password%"
        charset:  UTF8

但symfony抛出ParameterNotFoundExceptio。所以 - 可能我不能用点符号来做。 如何在config_test.yml文件中的测试标题下获取此参数?

0 个答案:

没有答案