Phrozn/Site/View/Base.php
private function parse()
    {
        if (isset($this->template, $this->frontMatter)) {
            return $this;
        }

        $source = $this->readSourceFile();

        $parts = preg_split('/[\n]*[-]{3}[\n]/', $source, 2);
        if (count($parts) === 2) {
            $this->frontMatter = Yaml::parse($parts[0]);
            $this->template = trim($parts[1]);
        } else {
            $this->frontMatter = array();
            $this->template = trim($source);
        }

        return $this;
    }
private function parse()
    {
        if (isset($this->template, $this->frontMatter)) {
            return $this;
        }

        $source = $this->readSourceFile();

        $parts = preg_split('/[\n]*[-]{3}[\n]/', $source, 2);
        if (count($parts) === 2) {
            $this->frontMatter = Yaml::parse($parts[0]);
            $this->template = trim($parts[1]);
        } else {
            $this->frontMatter = array();
            $this->template = trim($source);
        }

        return $this;
    }
private function parse ( ) { if ( isset ( $ this -> template , $ this -> frontMatter ) ) { return $ this ; } $ source = $ this -> readSourceFile ( ) ; $ parts = preg_split ( '/[\n]*[-]{3}[\n]/' , $ source , 2 ) ; if ( count ( $ parts ) === 2 ) { $ this -> frontMatter = Yaml :: parse ( $ parts [ 0 ] ) ; $ this -> template = trim ( $ parts [ 1 ] ) ; } else { $ this -> frontMatter = array ( ) ; $ this -> template = trim ( $ source ) ; } return $ this ; }
Parses input file into front matter and actual template content

@return \Phrozn\Site\View
Parses input file into front matter and actual template content