src/PHPDish/Bundle/ThemeBundle/Templating/TemplateNameParser.php
public function parse($name): TemplateReferenceInterface
    {
        if ($name instanceof TemplateReferenceInterface) {
            return $name;
        }

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

        //不符合twig别名模式的
        if (!preg_match('/^(?:@([^\/]*)|)(?:\/(.+))?\/(.+)\.([^\.]+)\.([^\.]+)$/', $name, $matches)) {
            return parent::parse($name);
        }

        $template = new TemplateReference(
            $matches[1] ? $matches[1] . 'Bundle' : '',
            $matches[2],
            $matches[3],
            $matches[4],
            $matches[5]
        );

        if ($template->get('bundle')) {
            try {
                $this->kernel->getBundle($template->get('bundle'));
            } catch (\Exception $e) {
                return parent::parse($name);
            }
        }

        return $this->cache[$name] = $template;
    }
public function parse($name): TemplateReferenceInterface
    {
        if ($name instanceof TemplateReferenceInterface) {
            return $name;
        }

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

        //不符合twig别名模式的
        if (!preg_match('/^(?:@([^\/]*)|)(?:\/(.+))?\/(.+)\.([^\.]+)\.([^\.]+)$/', $name, $matches)) {
            return parent::parse($name);
        }

        $template = new TemplateReference(
            $matches[1] ? $matches[1] . 'Bundle' : '',
            $matches[2],
            $matches[3],
            $matches[4],
            $matches[5]
        );

        if ($template->get('bundle')) {
            try {
                $this->kernel->getBundle($template->get('bundle'));
            } catch (\Exception $e) {
                return parent::parse($name);
            }
        }

        return $this->cache[$name] = $template;
    }
{@inheritdoc}