Sha256: 189cc23bcbe1772a62ebf98802ad5382f4e0fb14873f48b49d7824e5b9bf5701
Contents?: true
Size: 1.43 KB
Versions: 3
Compression:
Stored size: 1.43 KB
Contents
<?php /* SVN FILE: $Id: HamlCodeBlockNode.php 92 2010-05-20 17:42:59Z chris.l.yates $ */ /** * HamlCodeBlockNode class file. * @author Chris Yates <chris.l.yates@gmail.com> * @copyright Copyright (c) 2010 PBM Web Development * @license http://phamlp.googlecode.com/files/license.txt * @package PHamlP * @subpackage Haml.tree */ require_once('HamlRootNode.php'); require_once('HamlNodeExceptions.php'); /** * HamlCodeBlockNode class. * Represents a code block - if, elseif, else, foreach, do, and while. * @package PHamlP * @subpackage Haml.tree */ 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); } }
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
frontsau-0.0.3 | lib/Phamlp/haml/tree/HamlCodeBlockNode.php |
frontsau-0.0.2 | lib/Phamlp/haml/tree/HamlCodeBlockNode.php |
frontsau-0.0.1 | lib/Phamlp/haml/tree/HamlCodeBlockNode.php |