Phrozn/Site/View/Base.php
public function compile($vars = array())
    {
        $out = $this->render($vars);

        $outputFile = $this->getOutputFile();
        $destinationDir = dirname($outputFile);
        if (!is_dir($destinationDir)) {
            mkdir($destinationDir, 0777, true);
        }

        if (!is_dir($outputFile)) {
            file_put_contents($outputFile, $out);
        } else {
            throw new \RuntimeException(sprintf(
                'Output path "%s" is directory.', $outputFile));
        }

        return $out;
    }
public function compile($vars = array())
    {
        $out = $this->render($vars);

        $outputFile = $this->getOutputFile();
        $destinationDir = dirname($outputFile);
        if (!is_dir($destinationDir)) {
            mkdir($destinationDir, 0777, true);
        }

        if (!is_dir($outputFile)) {
            file_put_contents($outputFile, $out);
        } else {
            throw new \RuntimeException(sprintf(
                'Output path "%s" is directory.', $outputFile));
        }

        return $out;
    }
public function compile ( $ vars = array ( ) ) { $ out = $ this -> render ( $ vars ) ; $ outputFile = $ this -> getOutputFile ( ) ; $ destinationDir = dirname ( $ outputFile ) ; if ( ! is_dir ( $ destinationDir ) ) { mkdir ( $ destinationDir , 0777 , true ) ; } if ( ! is_dir ( $ outputFile ) ) { file_put_contents ( $ outputFile , $ out ) ; } else { throw new \ RuntimeException ( sprintf ( 'Output path "%s" is directory.' , $ outputFile ) ) ; } return $ out ; }
Create static version of a concrete page

@param array $vars List of variables passed to template engine

@return \Phrozn\Site\View
Create static version of a concrete page