我在app/config/parameters.yml中放了几个自定义变量.
parameters:
api_pass: apipass
api_user: apiuser
Run Code Online (Sandbox Code Playgroud)
我需要从我的控制器访问这些,并试图用它来获取它们
$this->get('api_user');
Run Code Online (Sandbox Code Playgroud)
从我的控制器文件中.当我尝试这个时,我收到此错误消息:
You have requested a non-existent service "api_user".
Run Code Online (Sandbox Code Playgroud)
这样做的正确方法是什么?