Nette\Utils\Finder::findDirectories PHP Method

findDirectories() public static method

Begins search for directories matching mask.
public static findDirectories ( $masks ) : self
return self
    public static function findDirectories(...$masks)
    {
        return (new static())->select(is_array($masks[0]) ? $masks[0] : $masks, 'isDir');
    }

Usage Example

 public function beforeRender()
 {
     $albumsPaths = null;
     $path = 'gallery/';
     $a = 0;
     $albumsNames = null;
     if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
         DIRECTORY_SEPARATOR == '/';
     } else {
         DIRECTORY_SEPARATOR == '\\';
     }
     foreach (Finder::findDirectories('*')->exclude('[0-9][0-9][0-9]', '_big')->in($path) as $key => $file) {
         $albumsNames[] = str_replace("gallery" . DIRECTORY_SEPARATOR, "", $key);
         $albumsPaths[] = $key;
         $i = 0;
         $nImg = 0;
         if (($files = @scandir($key)) && count($files) <= 2) {
             $albumImgs[$a] = null;
             $this->template->thumbs = null;
         } else {
             foreach (Finder::findFiles('*.jpg', '*.png', '*.jpeg', '*.JPG', '*.PNG', '*.JPEG')->in($key) as $key2 => $file) {
                 $albumImgs[$a] = $file->getFilename();
                 $i++;
             }
             $this->template->thumbs = $albumImgs;
         }
         $a++;
     }
     $this->template->albumsNames = $albumsNames;
 }
All Usage Examples Of Nette\Utils\Finder::findDirectories