You are here

private function HIncludeFragmentRenderer::templateExists in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php \Symfony\Component\HttpKernel\Fragment\HIncludeFragmentRenderer::templateExists()

Parameters

string $template:

Return value

bool

1 call to HIncludeFragmentRenderer::templateExists()
HIncludeFragmentRenderer::render in vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php
Additional available options:

File

vendor/symfony/http-kernel/Fragment/HIncludeFragmentRenderer.php, line 132

Class

HIncludeFragmentRenderer
Implements the Hinclude rendering strategy.

Namespace

Symfony\Component\HttpKernel\Fragment

Code

private function templateExists($template) {
  if ($this->templating instanceof EngineInterface) {
    try {
      return $this->templating
        ->exists($template);
    } catch (\InvalidArgumentException $e) {
      return false;
    }
  }
  $loader = $this->templating
    ->getLoader();
  if ($loader instanceof \Twig_ExistsLoaderInterface) {
    return $loader
      ->exists($template);
  }
  try {
    $loader
      ->getSource($template);
    return true;
  } catch (\Twig_Error_Loader $e) {
  }
  return false;
}