function RegexDirectoryIterator::__construct
Same name in other branches
- 9 core/lib/Drupal/Component/FileSystem/RegexDirectoryIterator.php \Drupal\Component\FileSystem\RegexDirectoryIterator::__construct()
- 8.9.x core/lib/Drupal/Component/FileSystem/RegexDirectoryIterator.php \Drupal\Component\FileSystem\RegexDirectoryIterator::__construct()
- 10 core/lib/Drupal/Component/FileSystem/RegexDirectoryIterator.php \Drupal\Component\FileSystem\RegexDirectoryIterator::__construct()
RegexDirectoryIterator constructor.
Parameters
string $path: The path to scan.
string $regex: The regular expression to match, including delimiters. For example, /\.yml$/ would list only files ending in .yml.
File
-
core/
lib/ Drupal/ Component/ FileSystem/ RegexDirectoryIterator.php, line 19
Class
- RegexDirectoryIterator
- Iterates over files whose names match a regular expression in a directory.
Namespace
Drupal\Component\FileSystemCode
public function __construct($path, $regex) {
parent::__construct(new \FilesystemIterator($path), $regex);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.