DbUpdateController::helpfulLinks

protected DbUpdateController::helpfulLinks(Request $request)

Provides links to the homepage and administration pages.

Parameters

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

Return value

array An array of links.

File

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

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'] = array(
    'title' => $this->t('Front page'),
    'url' => Url::fromRoute('<front>')->setOption('base_url', $base_url),
  );
  if ($this->account->hasPermission('access administration pages')) {
    $links['admin-pages'] = array(
      'title' => $this->t('Administration pages'),
      'url' => Url::fromRoute('system.admin')->setOption('base_url', $base_url),
    );
  }
  return $links;
}
doc_Drupal
2016-10-29 09:01:24
Comments
Leave a Comment

Please login to continue.