コード例 #1
0
ファイル: Renderer.php プロジェクト: icanboogie/render
 /**
  * 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;
 }
コード例 #2
0
 /**
  * @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;
 }