HamlCodeBlockNode.php in Sassy 7
File
phamlp/haml/tree/HamlCodeBlockNode.php
View source
<?php
require_once 'HamlRootNode.php';
require_once 'HamlNodeExceptions.php';
class HamlCodeBlockNode extends HamlNode {
public $else;
public $doWhile;
public function addElse($node) {
if (is_null($this->else)) {
$node->root = $this->root;
$node->parent = $this->parent;
$this->else = $node;
}
else {
$this->else
->addElse($node);
}
return $this;
}
public function render() {
$output = $this->renderer
->renderStartCodeBlock($this);
foreach ($this->children as $child) {
$output .= $child
->render();
}
$output .= empty($this->else) ? $this->renderer
->renderEndCodeBlock($this) : $this->else
->render();
return $this
->debug($output);
}
}
Classes
Name |
Description |
HamlCodeBlockNode |
HamlCodeBlockNode class.
Represents a code block - if, elseif, else, foreach, do, and while.
@package PHamlP
@subpackage Haml.tree |