Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By aspafford on
Is there a function for returning the parts of an aliased path? I'm looking for something equivalent to the arg() function.
I've been using something like this:
$path_parts = explode('/', drupal_get_path_alias($_GET['q']));
but this would return an empty array if there were just a single part, ie. http://localhost/about
Comments
_
afaik, it should still work.... try this to see:
You should get:
Edit: I made my own alias version (aarg) of the drupal api arg function:
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
you're right, that does
you're right, that does work. Anyways this function was what I was really going for, thanks!
welcome ;-) === "Give a man
welcome ;-)
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
static
WorldFallz: Just curious why you didn't include the
from the arg function
_
Probably just an oversight, though I confess, in this function I'm not sure what its purpose would be.
subscribe
subscribe
In drupal 7
In drupal 7 its just