function ExtensionPathResolver::getPath

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Extension/ExtensionPathResolver.php \Drupal\Core\Extension\ExtensionPathResolver::getPath()
  2. 10 core/lib/Drupal/Core/Extension/ExtensionPathResolver.php \Drupal\Core\Extension\ExtensionPathResolver::getPath()

Gets the extension directory path.

Parameters

string $type: The extension type.

string $name: The extension name.

Return value

string The extension info file path.

Throws

\Drupal\Core\Extension\Exception\UnknownExtensionTypeException If the extension type is unknown.

\Drupal\Core\Extension\Exception\UnknownExtensionException If the extension is unknown.

File

core/lib/Drupal/Core/Extension/ExtensionPathResolver.php, line 84

Class

ExtensionPathResolver
Factory for getting extension lists by type.

Namespace

Drupal\Core\Extension

Code

public function getPath(string $type, string $name) : string {
    return dirname($this->getPathname($type, $name));
}

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