$request = new Symfony\Component\HttpFoundation\Request()
$request->getRequestUri();
Seems to return the path and the query params. How to I get just the path?
strtok($request->getRequestUri(), '?');
...or...
$request->getBaseUrl() . $request->getPathInfo();
$request->getPathInfo()
is what you're looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With