You are here

class HamlRootNode in Sassy 7

HamlRootNode class. Also the root node of a document. @package PHamlP @subpackage Haml.tree

Hierarchy

Expanded class hierarchy of HamlRootNode

File

phamlp/haml/tree/HamlRootNode.php, line 20

View source
class HamlRootNode extends HamlNode {

  /**
   * @var HamlRenderer the renderer for this node
   */
  protected $renderer;

  /**
   * @var array options
   */
  protected $options;

  /**
   * Root HamlNode constructor.
   * @param array options for the tree
   * @return HamlNode
   */
  public function __construct($options) {
    $this->root = $this;
    $this->options = $options;
    $this->renderer = HamlRenderer::getRenderer($this->options['style'], array(
      'format' => $this->options['format'],
      'attrWrapper' => $this->options['attrWrapper'],
      'minimizedAttributes' => $this->options['minimizedAttributes'],
    ));
    $this->token = array(
      'level' => -1,
    );
  }

  /**
   * Render this node.
   * @return string the rendered node
   */
  public function render() {
    foreach ($this->children as $child) {
      $this->output .= $child
        ->render();
    }

    // foreach
    return $this->output;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
HamlNode::$children protected property *
HamlNode::$content public property *
HamlNode::$output protected property *
HamlNode::$parent protected property *
HamlNode::$root protected property *
HamlNode::$showOutput public property *
HamlNode::$showSource public property *
HamlNode::$token public property *
HamlNode::$_o private property *
HamlNode::$_r private property *
HamlNode::debug protected function
HamlNode::getChildren public function * Returns the node's children *
HamlNode::getContent public function * Returns the node's content and that of its child nodes *
HamlNode::getFilename private function * Returns the filename for this node *
HamlNode::getLastChild public function * Returns the last child node of this node. *
HamlNode::getLevel private function * Returns the indent level of this node. *
HamlNode::getLine private function * Returns the source for this node *
HamlNode::getOptions public function * Returns the options. *
HamlNode::getParent public function * Returns the node's parent *
HamlNode::getRenderer public function * Returns the renderer. *
HamlNode::getSource private function * Returns the source for this node *
HamlNode::hasChildren public function * Returns a value indicating if this node has children *
HamlNode::hasParent public function * Return a value indicating if this node has a parent *
HamlNode::setLevel private function * Sets the indent level of this node. * Used during rendering to give correct indentation. *
HamlNode::showSource 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::__get public function * Getter. *
HamlNode::__set public function * Setter. *
HamlRootNode::$options protected property *
HamlRootNode::$renderer protected property *
HamlRootNode::render public function * Render this node. * Overrides HamlNode::render
HamlRootNode::__construct public function * Root HamlNode constructor. * Overrides HamlNode::__construct