function current_path in Redis 7.2
Same name and namespace in other branches
- 7.3 redis.path.inc \current_path()
Return the current URL path of the page being viewed.
Examples:
- http://example.com/node/306 returns "node/306".
- http://example.com/drupalfolder/node/306 returns "node/306" while base_path() returns "/drupalfolder/".
- http://example.com/path/alias (which is a path alias for node/306) returns "node/306" as opposed to the path alias.
This function is not available in hook_boot() so use $_GET['q'] instead. However, be careful when doing that because in the case of Example #3 $_GET['q'] will contain "path/alias". If "node/306" is needed, calling drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL) makes this function available.
Return value
The current Drupal URL path.
See also
1 call to current_path()
- drupal_cache_system_paths in ./
redis.path.inc - Cache system paths for a page.
File
- ./
redis.path.inc, line 350 - Drupal default includes/path.inc file copy which only differs in:
Code
function current_path() {
return $_GET['q'];
}