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.
request_path() - returns the alias (ex.
base_path() - returns the base path for your Drupal site (ex.
/mysite/, if your site is accessible at
request_uri() - returns the full URI, including base path, alias, and any query arguments (ex.