function YamlDiscovery::__construct

Same name in this branch
  1. 10 core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDiscovery::__construct()
Same name in other branches
  1. 9 core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDiscovery::__construct()
  2. 9 core/lib/Drupal/Component/Discovery/YamlDiscovery.php \Drupal\Component\Discovery\YamlDiscovery::__construct()
  3. 8.9.x core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDiscovery::__construct()
  4. 8.9.x core/lib/Drupal/Component/Discovery/YamlDiscovery.php \Drupal\Component\Discovery\YamlDiscovery::__construct()
  5. 11.x core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php \Drupal\Core\Plugin\Discovery\YamlDiscovery::__construct()
  6. 11.x core/lib/Drupal/Component/Discovery/YamlDiscovery.php \Drupal\Component\Discovery\YamlDiscovery::__construct()

Constructs a YamlDiscovery object.

Parameters

string $name: The base filename to look for in each directory. The format will be $provider.$name.yml.

array $directories: An array of directories to scan, keyed by the provider.

File

core/lib/Drupal/Component/Discovery/YamlDiscovery.php, line 37

Class

YamlDiscovery
Provides discovery for YAML files within a given set of directories.

Namespace

Drupal\Component\Discovery

Code

public function __construct($name, array $directories) {
    $this->name = $name;
    $this->directories = $directories;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.