How do I read from parameters.yml in a controller in symfony2?

前端 未结 7 874
眼角桃花
眼角桃花 2020-12-07 13:49

I have put a couple of custom variables in my app/config/parameters.yml.

parameters:
    api_pass: apipass
    api_user: apiuser

I need to

7条回答
  •  误落风尘
    2020-12-07 14:03

    You can also use:

    $container->getParameter('api_user');
    

    Visit http://symfony.com/doc/current/service_container/parameters.html

提交回复
热议问题