I use a service that returns a default value defined in config file, but I need on runtime to update this value in order to use it later. Unfurtunately, it's always the default value that is returned.. my code:


    stHelper = defaultValue
  • services.php
    $di->setShared('helperBag', function() use ($config) {
    return $config->helpers;
  • controller.php
    public function modifyDefaultValueAction() {
            $this->getDi()->getHelperBag()->set('stHelper', 'newValue');
    public function getModifiedValueAction() {
            $this->view->modifiedValue = $this->getDi()->getHelperBag()->stHelper;

what's wrong?