You are here

protected function ProdCheckBase::generateLinkArray in Production check & Production monitor 8

Helper function to generate link array to pass to the t() function

4 calls to ProdCheckBase::generateLinkArray()
DbLog::failMessages in src/Plugin/ProdCheck/Server/DbLog.php
Returns the fail messages for the check
ErrorReporting::failMessages in src/Plugin/ProdCheck/Settings/ErrorReporting.php
Returns the fail messages for the check
ProdCheckBase::generateDescription in src/Plugin/ProdCheck/ProdCheckBase.php
Helper function to generate generic 'settings OK' description.
UserRegister::failMessages in src/Plugin/ProdCheck/Settings/UserRegister.php
Returns the fail messages for the check

File

src/Plugin/ProdCheck/ProdCheckBase.php, line 168

Class

ProdCheckBase
Base class for all the prod check plugins.

Namespace

Drupal\prod_check\Plugin\ProdCheck

Code

protected function generateLinkArray($title, $route_name, $fragment = NULL) {
  $url = Url::fromRoute($route_name);
  $url
    ->setOption('attributes', [
    'title' => $title,
  ]);
  $destination = $this->destination
    ->getAsArray();
  $url
    ->setOption('query', $destination);
  $url
    ->setAbsolute(TRUE);
  return [
    '%link' => $this->linkGenerator
      ->generate($title, $url),
  ];
}