SassParser::getOptions PHP Method

getOptions() public method

public getOptions ( )
    public function getOptions()
    {
        return array('callbacks' => $this->callbacks, 'filename' => $this->filename, 'functions' => $this->getFunctions(), 'line' => $this->getLine(), 'line_numbers' => $this->getLine_numbers(), 'load_path_functions' => $this->load_path_functions, 'load_paths' => $this->load_paths, 'property_syntax' => $this->property_syntax == "scss" ? null : $this->property_syntax, 'quiet' => $this->quiet, 'style' => $this->style, 'syntax' => $this->syntax);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Returns the parse tree for a file.
  * @param string $filename filename to parse
  * @param SassParser $parser Sass parser
  * @return SassRootNode
  */
 public static function get_tree($filename, &$parser)
 {
     $contents = self::get_file_contents($filename);
     $options = array_merge($parser->getOptions(), array('line' => 1));
     # attempt at cross-syntax imports.
     $ext = substr($filename, strrpos($filename, '.') + 1);
     if ($ext == self::SASS || $ext == self::SCSS) {
         $options['syntax'] = $ext;
     }
     $dirName = dirname($filename);
     $options['load_paths'][] = $dirName;
     if (!in_array($dirName, $parser->load_paths)) {
         $parser->load_paths[] = dirname($filename);
     }
     $sassParser = new SassParser($options);
     $tree = $sassParser->parse($contents, FALSE);
     return $tree;
 }