我已经为我的config.yml文件添加了一个设置:
app.config:
contact_email: somebody@gmail.com
...
Run Code Online (Sandbox Code Playgroud)
对于我的生活,我无法弄清楚如何将其读入变量.我在我的一个控制器中尝试过这样的东西:
$recipient =
$this->container->getParameter('contact_email');
Run Code Online (Sandbox Code Playgroud)
但我得到一个错误说:
必须定义参数"contact_email".
我已经清除了我的缓存,我也在Symfony2重新加载的站点文档中查看了所有内容,但我无法找到如何执行此操作.
可能现在太累了,无法弄明白这一点.有人能帮忙吗?