Parasolx

Professional in Drupal web development, theme designing, consultation and training

[Snippets] Drupal 7 base_path

02 Jan 2013 - 08:54 am

base_path()

Returns the base URL path (i.e., directory) of the Drupal installation.

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 "/".

$GLOBALS['base_url'] => http://example.com/drupal
base_path() => /drupal/
request_uri() => /drupal/documentation?page=1
request_path() => documentation
current_path() => node/26419
Kategori: 
Tags: 
snippets