You are here

public function HamlCodeBlockNode::addElse in Sassy 7

* Adds an "else" statement to this node. *

Parameters

SassIfNode "else" statement node to add: * @return SassIfNode this node

File

phamlp/haml/tree/HamlCodeBlockNode.php, line 36

Class

HamlCodeBlockNode
HamlCodeBlockNode class. Represents a code block - if, elseif, else, foreach, do, and while. @package PHamlP @subpackage Haml.tree

Code

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;
}