class HamlCodeBlockNode in Sassy 7
HamlCodeBlockNode class. Represents a code block - if, elseif, else, foreach, do, and while. @package PHamlP @subpackage Haml.tree
Hierarchy
- class \HamlNode
- class \HamlCodeBlockNode
Expanded class hierarchy of HamlCodeBlockNode
File
- phamlp/
haml/ tree/ HamlCodeBlockNode.php, line 21
View source
class HamlCodeBlockNode extends HamlNode {
/**
* @var HamlCodeBlockNode else nodes for if statements
*/
public $else;
/**
* @var string while clause for do-while loops
*/
public $doWhile;
/**
* Adds an "else" statement to this node.
* @param SassIfNode "else" statement node to add
* @return SassIfNode this node
*/
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();
}
// foreach
$output .= empty($this->else) ? $this->renderer
->renderEndCodeBlock($this) : $this->else
->render();
return $this
->debug($output);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HamlCodeBlockNode:: |
public | property | * | |
HamlCodeBlockNode:: |
public | property | * | |
HamlCodeBlockNode:: |
public | function | * Adds an "else" statement to this node. * | |
HamlCodeBlockNode:: |
public | function |
Overrides HamlNode:: |
|
HamlNode:: |
protected | property | * | |
HamlNode:: |
public | property | * | |
HamlNode:: |
protected | property | * | |
HamlNode:: |
protected | property | * | |
HamlNode:: |
protected | property | * | |
HamlNode:: |
public | property | * | |
HamlNode:: |
public | property | * | |
HamlNode:: |
public | property | * | |
HamlNode:: |
private | property | * | |
HamlNode:: |
private | property | * | |
HamlNode:: |
protected | function | ||
HamlNode:: |
public | function | * Returns the node's children * | |
HamlNode:: |
public | function | * Returns the node's content and that of its child nodes * | |
HamlNode:: |
private | function | * Returns the filename for this node * | |
HamlNode:: |
public | function | * Returns the last child node of this node. * | |
HamlNode:: |
private | function | * Returns the indent level of this node. * | |
HamlNode:: |
private | function | * Returns the source for this node * | |
HamlNode:: |
public | function | * Returns the options. * | |
HamlNode:: |
public | function | * Returns the node's parent * | |
HamlNode:: |
public | function | * Returns the renderer. * | |
HamlNode:: |
private | function | * Returns the source for this node * | |
HamlNode:: |
public | function | * Returns a value indicating if this node has children * | |
HamlNode:: |
public | function | * Return a value indicating if this node has a parent * | |
HamlNode:: |
private | function | * Sets the indent level of this node. * Used during rendering to give correct indentation. * | |
HamlNode:: |
protected | function | * Adds a comment with source debug information for the current line to the output. * The debug information is: * + source file (relative to the application path) * + line number * + indent level * + source code * | |
HamlNode:: |
public | function | 4 | |
HamlNode:: |
public | function | * Getter. * | |
HamlNode:: |
public | function | * Setter. * |