You are here

function HamlView::_render in Sassy 7

* Renders and returns output for given view filename with its * array of data. * *

Parameters

string Filename of the view: * @param array Data to include in rendered view * @return string Rendered output * @access protected

1 call to HamlView::_render()
HamlView::element in phamlp/Cake/views/haml.php
* Renders a piece of PHP with provided parameters and returns HTML, XML, or * any other string. * * This realizes the concept of Elements, (or "partial layouts") * and the $params array is used to send data to be used in the *…

File

phamlp/Cake/views/haml.php, line 257

Class

HamlView
Haml allows you to write view files in {@link Haml http://haml-lang.com/} and render them using {@link http://phamlp.googlecode.com PHamlP}.

Code

function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = false) {
  if (substr($___viewFn, strrpos($___viewFn, '.')) == $this->ext) {
    $cachedViewFile = $this
      ->_getCachedViewFileName($___viewFn);
    if (!$this->cache || @filemtime($___viewFn) > @filemtime($cachedViewFile)) {
      if (empty($this->haml)) {
        $this
          ->_init();
      }
      file_put_contents($cachedViewFile, $data = $this->haml
        ->parse($___viewFn));
      @chmod($cachedViewFile, $this->filePermission);
    }
    return parent::_render($cachedViewFile, $___dataForView, $loadHelpers, $cached);
  }
  else {
    return parent::_render($___viewFn, $___dataForView, $loadHelpers, $cached);
  }
}