欢迎各位兄弟 发布技术文章
这里的技术是共享的
6 libraries.module | libraries_get_path($name, $base_path = FALSE) |
7 libraries.module | libraries_get_path($name, $base_path = FALSE) |
8 libraries.module | libraries_get_path($name, $base_path = FALSE) |
Gets the path of a library.
$name: The machine name of a library to return the path for.
$base_path: Whether to prefix the resulting path with base_path().
The path to the specified library.
function libraries_get_path($name, $base_path = FALSE) {
static $libraries;
if (!isset($libraries)) {
$libraries = libraries_get_libraries();
}
$path = ($base_path ? base_path() : '');
if (!isset($libraries[$name])) {
// Most often, external libraries can be shared across multiple sites, so
// we return sites/all/libraries as the default path.
$path .= 'sites/all/libraries/' . $name;
}
else {
$path .= $libraries[$name];
}
return $path;
}
来自 http://www.drupalcontrib.org/api/drupal/contributions!libraries!libraries.module/function/libraries_get_path/6