Same name and namespace in other branches
- 10 core/includes/common.inc \base_path()
- 4.7.x includes/common.inc \base_path()
- 5.x includes/common.inc \base_path()
- 6.x includes/common.inc \base_path()
- 7.x includes/common.inc \base_path()
- 9 core/includes/common.inc \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/".
47 calls to base_path()
- AttachedAssetsTest::testAggregation in core/
tests/ Drupal/ KernelTests/ Core/ Asset/ AttachedAssetsTest.php - Integration test for CSS/JS aggregation.
- BigPipePlaceholderTestCases::cases in core/
modules/ big_pipe/ tests/ modules/ big_pipe_test/ src/ BigPipePlaceholderTestCases.php - Gets all BigPipe placeholder test cases.
- BigPipeTest::testNoJsDetection in core/
modules/ big_pipe/ tests/ src/ Functional/ BigPipeTest.php - Tests BigPipe's no-JS detection.
- color_scheme_form_submit in core/
modules/ color/ color.module - Form submission handler for color_scheme_form().
- CommentInterfaceTest::testCommentInterface in core/
modules/ comment/ tests/ src/ Functional/ CommentInterfaceTest.php - Tests the comment interface.
6 string references to 'base_path'
- DefaultSummary::buildOptionsForm in core/
modules/ views/ src/ Plugin/ views/ style/ DefaultSummary.php - Provide a form to edit options for this plugin.
- DefaultSummary::defineOptions in core/
modules/ views/ src/ Plugin/ views/ style/ DefaultSummary.php - Information about options for all kinds of purposes will be held here.
- FieldPluginBaseTest.php in core/
modules/ views/ tests/ src/ Unit/ Plugin/ field/ FieldPluginBaseTest.php - Contains \Drupal\Tests\views\Unit\Plugin\field\FieldPluginBaseTest.
- LanguageNegotiationUrlTest.php in core/
modules/ language/ tests/ src/ Unit/ LanguageNegotiationUrlTest.php - MigratePrivateFileTest::getFileMigrationInfo in core/
modules/ file/ tests/ src/ Kernel/ Migrate/ d7/ MigratePrivateFileTest.php - Returns information about the file to be migrated.
File
- core/
includes/ common.inc, line 431 - Common functions that many Drupal modules will need to reference.
Code
function base_path() {
return $GLOBALS['base_path'];
}