request

Drupal 8 - retrieving URI of current request

If you're used to relying on $_GET['q'] from Drupal 7 (& earlier), you might be in for a surprise with Drupal 8, as $_GET['q'] is no longer defined for any request. Instead, Drupal 8 ships with a series of helper functions:

current_path() - returns the internal Drupal path (ex. node/123)

Comments
  • Page 1