Leafo\ScssPhp\Compiler::addImportPath PHP Method

addImportPath() public method

Add import path
public addImportPath ( string $path )
$path string
    public function addImportPath($path)
    {
        if (!in_array($path, $this->importPaths)) {
            $this->importPaths[] = $path;
        }
    }

Usage Example

Beispiel #1
0
 public function get($cssFile)
 {
     $scssPath = PROJECT_ROOT . '/src/scss';
     $scssFile = $scssPath . '/' . str_replace('css', 'scss', $cssFile);
     /** Pass the route if file don't exists, will result in 404 */
     if (!file_exists($scssFile)) {
         return $this->slim->pass();
     }
     $this->slim->response->headers->set('Content-Type', 'text/css');
     $this->compiler->addImportPath($scssPath);
     echo $this->compiler->compile(file_get_contents($scssFile));
 }
All Usage Examples Of Leafo\ScssPhp\Compiler::addImportPath
Compiler