function base_path
Returns the base URL path (i.e., directory) of the Drupal installation.
Function base_path() adds a "/" to the beginning and end of the returned path if the path is not empty. At the very least, this will return "/".
Examples:
- http://example.com returns "/" because the path is empty.
- http://example.com/drupal/folder returns "/drupal/folder/".
11 calls to base_path()
- FieldPluginBase::renderAsLink in core/
modules/ views/ src/ Plugin/ views/ field/ FieldPluginBase.php - Render this field as a link, with the info from a fieldset set by the user.
- FieldPluginBase::renderText in core/
modules/ views/ src/ Plugin/ views/ field/ FieldPluginBase.php - Performs an advanced text render for the item.
- FileUrlGenerator::doGenerateString in core/
lib/ Drupal/ Core/ File/ FileUrlGenerator.php - Creates an absolute web-accessible URL string.
- FilterHooks::filterSecureImageAlter in core/
modules/ filter/ src/ Hook/ FilterHooks.php - Implements hook_filter_secure_image_alter().
- hook_filter_secure_image_alter in core/
modules/ filter/ filter.api.php - Alters images with an invalid source.
File
-
core/
includes/ common.inc, line 126
Code
function base_path() {
return $GLOBALS['base_path'];
}