You are here

public function HamlSassFilter::run in Sassy 7

* Run the filter *

Parameters

string text to filter: * @return string filtered text

Overrides HamlBaseFilter::run

File

phamlp/haml/filters/HamlSassFilter.php, line 30

Class

HamlSassFilter
{@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

Code

public function run($text) {
  $sass = new SassParser();
  $css = new HamlCssFilter();
  $css
    ->init();
  return $css
    ->run($sass
    ->toCss(preg_replace(HamlParser::MATCH_INTERPOLATION, '<?php echo \\1; ?>', $text), false));
}