function ModulesListConfirmForm::buildMessageList

Same name and namespace in other branches
  1. 10 core/modules/system/src/Form/ModulesListConfirmForm.php \Drupal\system\Form\ModulesListConfirmForm::buildMessageList()
  2. 9 core/modules/system/src/Form/ModulesListConfirmForm.php \Drupal\system\Form\ModulesListConfirmForm::buildMessageList()
  3. 8.9.x core/modules/system/src/Form/ModulesListConfirmForm.php \Drupal\system\Form\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()

2 calls to ModulesListConfirmForm::buildMessageList()
ModulesListConfirmForm::buildForm in core/modules/system/src/Form/ModulesListConfirmForm.php
Form constructor.
ModulesListNonStableConfirmForm::buildMessageList in core/modules/system/src/Form/ModulesListNonStableConfirmForm.php
Builds the message list for the confirmation form.
1 method overrides ModulesListConfirmForm::buildMessageList()
ModulesListNonStableConfirmForm::buildMessageList in core/modules/system/src/Form/ModulesListNonStableConfirmForm.php
Builds the message list for the confirmation form.

File

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

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[] = [
        [
          '#markup' => $this->formatPlural(count($dependencies), 'You must install the following module to install @module:', 'You must install the following modules to install @module:', [
            '@module' => $this->modules['install'][$module],
          ]),
        ],
        [
          '#theme' => 'item_list',
          '#list_type' => 'ul',
          '#items' => $dependencies,
        ],
      ];
    }
  }
  return $items;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.