You are here

protected function Twig_Template::loadTemplate in Translation template extractor 7.3

1 call to Twig_Template::loadTemplate()
Twig_Template::getParent in vendor/Twig/Template.php
Returns the parent template.

File

vendor/Twig/Template.php, line 275

Class

Twig_Template
Default base class for compiled templates.

Code

protected function loadTemplate($template, $templateName = null, $line = null, $index = null) {
  try {
    if (is_array($template)) {
      return $this->env
        ->resolveTemplate($template);
    }
    if ($template instanceof self) {
      return $template;
    }
    return $this->env
      ->loadTemplate($template, $index);
  } catch (Twig_Error $e) {
    if (!$e
      ->getTemplateFile()) {
      $e
        ->setTemplateFile($templateName ? $templateName : $this
        ->getTemplateName());
    }
    if ($e
      ->getTemplateLine()) {
      throw $e;
    }
    if (!$line) {
      $e
        ->guess();
    }
    else {
      $e
        ->setTemplateLine($line);
    }
    throw $e;
  }
}