W3cubDocs

/Drupal 8

function drupal_get_path

drupal_get_path($type, $name)

Returns the path to a system item (module, theme, etc.).

Parameters

$type: The type of the item; one of 'core', 'profile', 'module', 'theme', or 'theme_engine'.

$name: The name of the item for which the path is requested. Ignored for $type 'core'.

Return value

The path to the requested item or an empty string if the item is not found.

File

core/includes/bootstrap.inc, line 256
Functions that need to be loaded on every Drupal request.

Code

function drupal_get_path($type, $name) {
  return dirname(drupal_get_filename($type, $name));
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!bootstrap.inc/function/drupal_get_path/8.1.x