class HamlElementNode in Sassy 7
HamlElementNode class. Represents an element. @package PHamlP @subpackage Haml.tree
Hierarchy
- class \HamlNode
- class \HamlElementNode
Expanded class hierarchy of HamlElementNode
File
- phamlp/
haml/ tree/ HamlElementNode.php, line 21
View source
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;
}
// foreach
return $this
->debug($this->output . (isset($child) && $child instanceof HamlElementNode && $child->whitespaceControl['outer']['right'] ? ltrim($close) : $close));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HamlElementNode:: |
public | property | ||
HamlElementNode:: |
public | property | ||
HamlElementNode:: |
public | property | ||
HamlElementNode:: |
public | property | ||
HamlElementNode:: |
public | property | ||
HamlElementNode:: |
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. * |