Phrozn\Twig\Loader\String::getSource PHP Method

getSource() public method

Gets the source code of a template, given its name.
public getSource ( string $name ) : string
$name string Template content
return string The template source code
    public function getSource($name)
    {
        // strip front-matter
        $parts = preg_split('/[\\n]*[-]{3}[\\n]/', $name, 2);
        if (count($parts) === 2) {
            return ltrim($parts[1]);
        }
        return $name;
    }