kirby/vendor/getkirby/toolkit/lib/folder.php
/**
   * Return a collection of subfolders
   * 
   * @param array $ignore
   * @param boolean $plain
   * @return mixed If $plain is true an array will be returned. Otherwise a Collection
   */
Return a collection of subfolders

@param array $ignore
@param boolean $plain
@return mixed If $plain is true an array will be returned. Otherwise a Collection
Return a collection of subfolders @param array $ignore @param boolean $plain @return mixed If $plain is true an array will be returned . Otherwise a Collection
public function children($ignore = null, $plain = false) {
    $raw = $this->scan($ignore);
    if($plain) {
      $content = array();
      foreach($raw as $file) {
        if(is_dir($this->root . DS . $file)) $content[] = $file;
      }
    } else {
      $content = new Collection();
      foreach($raw as $file) {
        if(is_dir($this->root . DS . $file)) {
          $content->append($file, new static($this->root . DS . $file));
        }
      }
    }
    return $content;
  }
public function children ( $ ignore = null , $ plain = false ) { $ raw = $ this -> scan ( $ ignore ) ; if ( $ plain ) { $ content = array ( ) ; foreach ( $ raw as $ file ) { if ( is_dir ( $ this -> root . DS . $ file ) ) $ content [ ] = $ file ; } } else { $ content = new Collection ( ) ; foreach ( $ raw as $ file ) { if ( is_dir ( $ this -> root . DS . $ file ) ) { $ content -> append ( $ file , new static ( $ this -> root . DS . $ file ) ) ; } } } return $ content ; }
Return a collection of subfolders
Return a collection of subfolders