Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DbUpdateController.php

function DbUpdateController::helpfulLinks

Provides links to the homepage and administration pages.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The current request.

Return value

array An array of links.

2 calls to DbUpdateController::helpfulLinks()
DbUpdateController::results in core/modules/system/src/Controller/DbUpdateController.php
Displays results of the update script with any accompanying errors.
DbUpdateController::selection in core/modules/system/src/Controller/DbUpdateController.php
Renders a list of available database updates.

File

core/modules/system/src/Controller/DbUpdateController.php, line 699

Class

DbUpdateController
Controller routines for database update routes.

Namespace

Drupal\system\Controller

Code

protected function helpfulLinks(Request $request) {
    // @todo Simplify with https://www.drupal.org/node/2548095
    $base_url = str_replace('/update.php', '', $request->getBaseUrl());
    $links['front'] = [
        'title' => $this->t('Front page'),
        'url' => Url::fromRoute('<front>')->setOption('base_url', $base_url),
    ];
    if ($this->account
        ->hasPermission('access administration pages')) {
        $links['admin-pages'] = [
            'title' => $this->t('Administration pages'),
            'url' => Url::fromRoute('system.admin')->setOption('base_url', $base_url),
        ];
    }
    return $links;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal