How do I read configuration settings from Symfony2 config.yml?

前端 未结 6 1716
花落未央
花落未央 2020-11-27 09:16

I have added a setting to my config.yml file as such:

app.config:
    contact_email: somebody@gmail.com
    ...

For the life of me, I can\'

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 10:00

    Rather than defining contact_email within app.config, define it in a parameters entry:

    parameters:
        contact_email: somebody@gmail.com
    

    You should find the call you are making within your controller now works.

提交回复
热议问题