You are here

class HamlScssFilter in Sassy 7

{@link Sass http://sass-lang.com/} Filter for {@link http://haml-lang.com/ Haml} class. Parses the text as Sass then calls the CSS filter. Useful for including inline Sass. @package PHamlP @subpackage Haml.filters

Hierarchy

Expanded class hierarchy of HamlScssFilter

File

phamlp/haml/filters/HamlScssFilter.php, line 24

View source
class HamlScssFilter extends HamlBaseFilter {

  /**
   * Run the filter
   * @param string text to filter
   * @return string filtered text
   */
  public function run($text) {
    $sass = new SassParser(array(
      'syntax' => 'scss',
    ));
    $css = new HamlCssFilter();
    $css
      ->init();
    return $css
      ->run($sass
      ->toCss(preg_replace(HamlParser::MATCH_INTERPOLATION, '<?php echo \\1; ?>', $text), false));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
HamlBaseFilter::init public function * Initialise the filter. 2
HamlScssFilter::run public function * Run the filter * Overrides HamlBaseFilter::run