function Module::postInstallTasks

Same name in other branches
  1. 9 core/lib/Drupal/Core/Updater/Module.php \Drupal\Core\Updater\Module::postInstallTasks()
  2. 8.9.x core/lib/Drupal/Core/Updater/Module.php \Drupal\Core\Updater\Module::postInstallTasks()

Overrides Updater::postInstallTasks

File

core/lib/Drupal/Core/Updater/Module.php, line 114

Class

Module
Defines a class for updating modules.

Namespace

Drupal\Core\Updater

Code

public function postInstallTasks() {
    // Since this is being called outside of the primary front controller,
    // the base_url needs to be set explicitly to ensure that links are
    // relative to the site root.
    // @todo Simplify with https://www.drupal.org/node/2548095
    $default_options = [
        '#type' => 'link',
        '#options' => [
            'absolute' => TRUE,
            'base_url' => $GLOBALS['base_url'],
        ],
    ];
    return [
        $default_options + [
            '#url' => Url::fromRoute('update.module_install'),
            '#title' => t('Add another module'),
        ],
        $default_options + [
            '#url' => Url::fromRoute('system.modules_list'),
            '#title' => t('Install newly added modules'),
        ],
        $default_options + [
            '#url' => Url::fromRoute('system.admin'),
            '#title' => t('Administration pages'),
        ],
    ];
}

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