You are here

public function SassPropertyNode::getNamespace in Sassy 7.3

Same name and namespace in other branches
  1. 7 phamlp/sass/tree/SassPropertyNode.php \SassPropertyNode::getNamespace()

Returns the namespace for this node

Return value

string the namespace for this node

File

phpsass/tree/SassPropertyNode.php, line 144

Class

SassPropertyNode
SassPropertyNode class. Represents a CSS property. @package PHamlP @subpackage Sass.tree

Code

public function getNamespace() {
  $namespace = array();
  $parent = $this->parent;
  do {
    if ($parent instanceof SassPropertyNode) {
      $namespace[] = $parent->name;
    }
    $parent = $parent->parent;
  } while (is_object($parent));
  return join('-', array_reverse($namespace));
}