Reputation: 91193
In Symfony, how do you get the current URI slugs as an array?
www.mysite.com/this/that/test/hello/world/7?whatever=true
What command is used to get the following array:
[0] => 'this',
[1] => 'that',
[2] => 'test',
[3] => 'hello',
[4] => 'world',
[5] => '7'
Upvotes: 0
Views: 762
Reputation: 3714
Try the following:
explode('/', $request->getPathInfo());
(I don't actually know where you'll get your request object from, so you'll may have to rename the variable)
Upvotes: 2
Reputation: 2545
This should work:
explode('/',$this->getContext()->getRouting()->getCurrentInternalUri());
Upvotes: 0