Exemplo n.º 1
0
 /**
  * Resolve a template pathname from its name and type.
  *
  * @param string $name
  *
  * @return string Template pathname.
  *
  * @throws TemplateNotFound if the template pathname cannot be resolved.
  */
 public function resolve_template($name)
 {
     $template_pathname = $this->template_resolver->resolve($name, $this->engines->extensions, $tried);
     if (!$template_pathname) {
         throw new TemplateNotFound("There is no template matching `{$name}`.", $tried ?: []);
     }
     return $template_pathname;
 }
 /**
  * @inheritdoc
  */
 public function find_renderer($class)
 {
     if ($this instanceof $class) {
         return $this;
     }
     if ($this->template_resolver instanceof $class) {
         return $this->template_resolver;
     }
     if ($this->template_resolver instanceof TemplateResolverDecorator) {
         return $this->template_resolver->find_renderer($class);
     }
     return null;
 }