Skip to content

Instantly share code, notes, and snippets.

@rpayanm
Last active March 15, 2022 17:15
Show Gist options
  • Save rpayanm/3a6215fb4ec7b532683abffcfe6f0a9b to your computer and use it in GitHub Desktop.
Save rpayanm/3a6215fb4ec7b532683abffcfe6f0a9b to your computer and use it in GitHub Desktop.

No importa que el sitio sea www.example.com/subsite, como por ejemplo portalbase de JND o MSP. Si visitamos la url www.example.com/admin/people o www.example.com/msp/admin/people

$current_path = \Drupal::request()->getPathInfo();
echo $current_path;

El resultado del ejemplo sería:

/admin/people
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment