ModulesListConfirmForm::buildMessageList

protected ModulesListConfirmForm::buildMessageList()

Builds the message list for the confirmation form.

Return value

\Drupal\Component\Render\MarkupInterface[] Array of markup for the list of messages on the form.

See also

\Drupal\system\Form\ModulesListForm::buildModuleList()

File

core/modules/system/src/Form/ModulesListConfirmForm.php, line 139

Class

ModulesListConfirmForm
Builds a confirmation form for enabling modules with dependencies.

Namespace

Drupal\system\Form

Code

protected function buildMessageList() {
  $items = [];
  if (!empty($this->modules['dependencies'])) {
    // Display a list of required modules that have to be installed as well
    // but were not manually selected.
    foreach ($this->modules['dependencies'] as $module => $dependencies) {
      $items[] = $this->formatPlural(count($dependencies), 'You must enable the @required module to install @module.', 'You must enable the @required modules to install @module.', [
        '@module' => $this->modules['install'][$module],
        // It is safe to implode this because module names are not translated
        // markup and so will not be double-escaped.
        '@required' => implode(', ', $dependencies),
      ]);
    }
  }
  return $items;
}
doc_Drupal
2016-10-29 09:29:30
Comments
Leave a Comment

Please login to continue.