src/Leevel/View/Connect.php
protected function parseFile(?string $tpl = null, ?string $ext = ''): string
    {
        $tpl = trim(str_replace('->', '.', $tpl));

        // 完整路径或者变量以及表达式路径
        if (pathinfo($tpl, PATHINFO_EXTENSION) ||
            0 === strpos($tpl, '$') ||
            false !== strpos($tpl, '(')) {
            return $this->formatFile($tpl);
        }

        if (!$this->option['theme_path']) {
            throw new RuntimeException('Theme path must be set.');
        }

        return $this->option['theme_path'].'/'.$tpl.
            ($ext ?: $this->option['suffix']);
    }
protected function parseFile(?string $tpl = null, ?string $ext = ''): string
    {
        $tpl = trim(str_replace('->', '.', $tpl));

        // 完整路径或者变量以及表达式路径
        if (pathinfo($tpl, PATHINFO_EXTENSION) ||
            0 === strpos($tpl, '$') ||
            false !== strpos($tpl, '(')) {
            return $this->formatFile($tpl);
        }

        if (!$this->option['theme_path']) {
            throw new RuntimeException('Theme path must be set.');
        }

        return $this->option['theme_path'].'/'.$tpl.
            ($ext ?: $this->option['suffix']);
    }
分析模板真实路径.

@param string $tpl
@param string $ext

@return string