function Extension::getPath

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::getPath()
  2. 10 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::getPath()
  3. 11.x core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::getPath()

Returns the relative path of the extension.

Return value

string

2 calls to Extension::getPath()
Extension::getExtensionPathname in core/lib/Drupal/Core/Extension/Extension.php
Returns the relative path of the main extension file, if any.
Extension::load in core/lib/Drupal/Core/Extension/Extension.php
Loads the main extension file, if any.

File

core/lib/Drupal/Core/Extension/Extension.php, line 98

Class

Extension
Defines an extension (file) object.

Namespace

Drupal\Core\Extension

Code

public function getPath() {
    return dirname($this->pathname);
}

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