get or set parameter in controller


$email_address = $this->container->getParameter('email_address');
If we don’t want to use the config.yml file and want to set your own parameter through a bundle controller or service you can set a parameter using:
$this->container->setParameter('email_address', 'someone.else@anybody.com');

评论

热门博文