You are here

protected function Haml::generateViewFile in Sassy 7

* Parses the source view file and saves the results as another file. * This method is required by the parent class. *

Parameters

string the source view file path: * @param string the resulting view file path

1 call to Haml::generateViewFile()
Haml::renderFile in phamlp/Yii/phamlp/Haml.php
* Renders a view file. * This method is required by {@link IViewRenderer}. *

File

phamlp/Yii/phamlp/Haml.php, line 188

Class

Haml
HamlViewRenderer allows you to write view files in {@link Haml http://haml-lang.com/}. @package PHamlP @subpackage Yii

Code

protected function generateViewFile($sourceFile, $viewFile) {
  if (substr($sourceFile, strlen($this->fileExtension) * -1) === $this->fileExtension) {
    if (empty($this->haml)) {
      $this
        ->_init();
    }
    $data = $this->haml
      ->parse($sourceFile);
  }
  else {
    $data = file_get_contents($sourceFile);
  }
  file_put_contents($viewFile, $data);
}