You are here

protected function Twig_Template::loadTemplate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/lib/Twig/Template.php \Twig_Template::loadTemplate()
1 call to Twig_Template::loadTemplate()
Twig_Template::getParent in vendor/twig/twig/lib/Twig/Template.php
Returns the parent template.

File

vendor/twig/twig/lib/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;
  }
}