src/Leevel/View/Parser.php
protected function getLocationSource(array $position): string
    {
        $line = explode(
            PHP_EOL,
            htmlentities(
                substr(
                    file_get_contents($this->sourceFile),
                    $position['start'],
                    $position['end']
                )
            )
        );

        $line[] = '<div class="template-key">'.
            array_pop($line).
            '</div>';

        return '<pre><code>'.
            implode(PHP_EOL, $line).
            '</code></pre>';
    }
protected function getLocationSource(array $position): string
    {
        $line = explode(
            PHP_EOL,
            htmlentities(
                substr(
                    file_get_contents($this->sourceFile),
                    $position['start'],
                    $position['end']
                )
            )
        );

        $line[] = '<div class="template-key">'.
            array_pop($line).
            '</div>';

        return '<pre><code>'.
            implode(PHP_EOL, $line).
            '</code></pre>';
    }
取得模板位置源码

@param array $position

@return string