modulesEnabledConfirmationMessage example

// We can exit here because at least one modules has dependencies       // which we have to prompt the user for in a confirmation form.       return;
    }

    // Install the given modules.     if (!empty($modules['install'])) {
      try {
        $this->moduleInstaller->install(array_keys($modules['install']));
        $this->messenger()
          ->addStatus($this->modulesEnabledConfirmationMessage($modules['install']));
      }
      catch (PreExistingConfigException $e) {
        $this->messenger()->addError($this->modulesFailToEnableMessage($modules$e));
        return;
      }
      catch (UnmetDependenciesException $e) {
        $this->messenger()->addError(
          $e->getTranslatedMessage($this->getStringTranslation()$modules['install'][$e->getExtension()])
        );
        return;
      }
    }
catch (UnmetDependenciesException $e) {
        $this->messenger()->addError(
          $e->getTranslatedMessage($this->getStringTranslation()$this->modules['install'][$e->getExtension()])
        );
        return;
      }

      // Unset the messenger to make sure that we'll get the service from the       // new container.       $this->messenger = NULL;
      $this->messenger()
        ->addStatus($this->modulesEnabledConfirmationMessage($this->modules['install']));
    }

    $form_state->setRedirectUrl($this->getCancelUrl());
  }

}
Home | Imprint | This part of the site doesn't use cookies.