Пример #1
0
 protected function findAssets(PatternLabInterface $patternlab)
 {
     $dir = new \RecursiveDirectoryIterator($this->path, \FilesystemIterator::SKIP_DOTS);
     $files = new \RecursiveIteratorIterator($dir, \RecursiveIteratorIterator::LEAVES_ONLY);
     foreach ($files as $file => $obj) {
         $path = substr($file, strlen($this->path) + 1);
         if (!$patternlab->isHiddenFile($path) && !$patternlab->isIgnoredFile($path)) {
             $this->assets[$path] = new Asset($path, $file);
         }
     }
 }
Пример #2
0
 protected function makeIndex(PatternLabInterface $patternlab)
 {
     $this->index = [];
     foreach ($patternlab->getPatterns() as $pattern) {
         $file = $pattern->getFile();
         $partial = $pattern->getPartial();
         $path = PatternLab::normalizePath($pattern->getPath());
         $this->index[$partial] = $file;
         $this->index[$path] = $file;
     }
 }
Пример #3
0
 protected function loadControls()
 {
     $this->controls = ['ishControlsHide' => [], 'mqs' => $this->getMediaQueries()];
     foreach ($this->patternlab->getHiddenControls() as $control) {
         $this->controls['ishControlsHide'][$control] = 'true';
     }
 }
Пример #4
0
 /**
  * Make all style guide asset file objects
  */
 protected function makeStyleguideAssetFiles()
 {
     foreach ($this->patternlab->getStyleguideAssetDirectories() as $dir) {
         $assets = new AssetDirectory($this->patternlab, $dir);
         foreach ($assets->getAssets() as $asset) {
             $this->addFile(new StyleguideAssetFile($asset));
         }
     }
 }