findImport() public method

Return the file path for an import url if it exists
public findImport ( string $url ) : string | null
$url string
return string | null
示例#1
0
 public function getChildren(AssetFactory $factory, $content, $loadPath = null)
 {
     $sc = new Compiler();
     $sc->addImportPath($loadPath);
     foreach ($this->importPaths as $path) {
         $sc->addImportPath($path);
     }
     $children = array();
     foreach (CssUtils::extractImports($content) as $match) {
         $file = $sc->findImport($match);
         if ($file) {
             $children[] = $child = $factory->createAsset($file, array(), array('root' => $loadPath));
             $child->load();
             $children = array_merge($children, $this->getChildren($factory, $child->getContent(), $loadPath));
         }
     }
     return $children;
 }