HamlElementNode.php in Sassy 7
File
phamlp/haml/tree/HamlElementNode.php
View source
<?php
require_once 'HamlRootNode.php';
require_once 'HamlNodeExceptions.php';
class HamlElementNode extends HamlNode {
public $isBlock;
public $isSelfClosing;
public $attributes;
public $whitespaceControl;
public $escapeHTML;
public function render() {
$renderer = $this->renderer;
$this->output = $renderer
->renderOpeningTag($this);
$close = $renderer
->renderClosingTag($this);
if ($this->whitespaceControl['outer']['left']) {
$this->output = ltrim($this->output);
$close = rtrim($close);
$this->parent->output = rtrim($this->parent->output);
}
foreach ($this->children as $index => $child) {
$output = $child
->render();
$output = $this->whitespaceControl['inner'] ? trim($output) : $output;
if ($index && $this->children[$index - 1] instanceof HamlElementNode && $this->children[$index - 1]->whitespaceControl['outer']['right']) {
$output = ltrim($output);
}
$this->output .= $output;
}
return $this
->debug($this->output . (isset($child) && $child instanceof HamlElementNode && $child->whitespaceControl['outer']['right'] ? ltrim($close) : $close));
}
}
Classes
Name |
Description |
HamlElementNode |
HamlElementNode class.
Represents an element.
@package PHamlP
@subpackage Haml.tree |