src/PHPDish/Bundle/ThemeBundle/Twig/FilesystemLoader.php
public function findTemplate($template, $throw = true)
    {
        //补全模板名称后缀
        $logicalName = (string) $template . $this->templateLogicNameSuffix;

        if (isset($this->cache[$logicalName])) {
            return $this->cache[$logicalName];
        }

        $file = null;
        $previous = null;

        try {
            $templateReference  = $this->parser->parse($template);
            $file = $this->locator->locate($templateReference);
        } catch (\Exception $e) {
            $previous = $e;
            // for BC
            try {
                $file = parent::findTemplate((string) $template);
            } catch (LoaderError $e) {
                $previous = $e;
            }
        }

        if (false === $file || null === $file) {
            if ($throw) {
                throw new LoaderError(sprintf('Unable to find template "%s".', $logicalName), -1, null, $previous);
            }

            return false;
        }
        return $this->cache[$logicalName] = $file;
    }
public function findTemplate($template, $throw = true)
    {
        //补全模板名称后缀
        $logicalName = (string) $template . $this->templateLogicNameSuffix;

        if (isset($this->cache[$logicalName])) {
            return $this->cache[$logicalName];
        }

        $file = null;
        $previous = null;

        try {
            $templateReference  = $this->parser->parse($template);
            $file = $this->locator->locate($templateReference);
        } catch (\Exception $e) {
            $previous = $e;
            // for BC
            try {
                $file = parent::findTemplate((string) $template);
            } catch (LoaderError $e) {
                $previous = $e;
            }
        }

        if (false === $file || null === $file) {
            if ($throw) {
                throw new LoaderError(sprintf('Unable to find template "%s".', $logicalName), -1, null, $previous);
            }

            return false;
        }
        return $this->cache[$logicalName] = $file;
    }
{@inheritdoc}