In my config.yml, I have this:
parameters: gitek.centro_por_defecto: 1
Now I want to change this value from my controller using a form, for example:
public function seleccionAction(Request $request) { $entity = new Centro(); $form = $this->createForm(new SeleccionType(), $entity); $centro = $this->container->getParameter('gitek.centro_por_defecto'); if ($this->getRequest()->getMethod() == 'POST') { $form->bind($this->getRequest()); if ($form->isValid()) { $miseleccion = $request->request->get('selecciontype'); $this->container->setParameter('gitek.centro_por_defecto', $miseleccion['nombre']);
I get the error Impossible to call set() on a frozen ParameterBag. all the time. Any help or hint?
source share