How can I get values from config.yml or security.yml in the controller in Symfony2? I am not talking about the ones I define under “parameters” key (which one can easily get by $this->container->getParameter()), but those stored in upper levels.
For example, how can I get the security.firewalls.my_firewall.remember_me.key value?
What’s wrong with defining a value as a parameter and assigning it to a value in
config.ymlorsecurity.yml? You can easily get it from a controller then.For example, add a parameter to the
parameters.inifile:And then use it in the
security.ymlfile:And access it from a controller the way you already do.