You are here

public function IdeLinkGenerator::generateLink in Devel 8.2

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Helper/IdeLinkGenerator.php \Drupal\webprofiler\Helper\IdeLinkGenerator::generateLink()
  2. 8 webprofiler/src/Helper/IdeLinkGenerator.php \Drupal\webprofiler\Helper\IdeLinkGenerator::generateLink()
  3. 4.x webprofiler/src/Helper/IdeLinkGenerator.php \Drupal\webprofiler\Helper\IdeLinkGenerator::generateLink()

Parameters

$file:

$line:

Return value

string

Overrides IdeLinkGeneratorInterface::generateLink

File

webprofiler/src/Helper/IdeLinkGenerator.php, line 28

Class

IdeLinkGenerator
Class IdeLinkGenerator.

Namespace

Drupal\webprofiler\Helper

Code

public function generateLink($file, $line) {
  $ide_link = $this->config_factory
    ->get('webprofiler.config')
    ->get('ide_link');
  $ide_link_remote = $this->config_factory
    ->get('webprofiler.config')
    ->get('ide_link_remote');
  $ide_link_local = $this->config_factory
    ->get('webprofiler.config')
    ->get('ide_link_local');
  $file = str_replace($ide_link_remote, $ide_link_local, $file);
  return new FormattableMarkup($ide_link, [
    '@file' => $file,
    '@line' => $line,
  ]);
}