You are here

public function SassContext::getMixin in Sassy 7.3

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

Returns a mixin

Parameters

string name of mixin to return:

Return value

SassMixinDefinitionNode the mixin

Throws

SassContextException if mixin not defined in this context

File

phpsass/tree/SassContext.php, line 71

Class

SassContext
SassContext class. Defines the context that the parser is operating in and so allows variables to be scoped. A new context is created for Mixins and imported files. @package PHamlP @subpackage Sass.tree

Code

public function getMixin($name) {
  if (isset($this->mixins[$name])) {
    return $this->mixins[$name];
  }
  elseif (!empty($this->parent)) {
    return $this->parent
      ->getMixin($name);
  }
  throw new SassContextException('Undefined Mixin: ' . $name, $this->node);
}