You are here

public function TemplateManager::getName in Devel 4.x

Same name and namespace in other branches
  1. 8.3 webprofiler/src/Profiler/TemplateManager.php \Drupal\webprofiler\Profiler\TemplateManager::getName()
  2. 8 webprofiler/src/Profiler/TemplateManager.php \Drupal\webprofiler\Profiler\TemplateManager::getName()
  3. 8.2 webprofiler/src/Profiler/TemplateManager.php \Drupal\webprofiler\Profiler\TemplateManager::getName()

Gets the template name for a given panel.

Parameters

\Symfony\Component\HttpKernel\Profiler\Profile $profile:

string $panel:

Return value

mixed

Throws

\Symfony\Component\HttpKernel\Exception\NotFoundHttpException

File

webprofiler/src/Profiler/TemplateManager.php, line 68

Class

TemplateManager
Profiler Templates Manager.

Namespace

Drupal\webprofiler\Profiler

Code

public function getName(Profile $profile, $panel) {
  $templates = $this
    ->getNames($profile);
  if (!isset($templates[$panel])) {
    throw new NotFoundHttpException(sprintf('Panel "%s" is not registered in profiler or is not present in viewed profile.', $panel));
  }
  return $templates[$panel];
}