I’m using URL’s in the format: localhost/controller/action/param1/param2/etc… I then route the request using something along the lines of:
list($controller, $action, $params) = explode('/', $request);
call_user_func_array(array(new $controller, $action), explode('/', $params));
Now I want to pass a directory path as a parameter, for example: localhost/images/gallery/path/to/somedir, but this obviously breaks up each directory into a separate argument.
What are my options? Should I use a different delimiter? Should I append it in a query string and then use $_GET? This is my first time using friendly URLs so I’m looking for any recommendations or best practices on how to do this in such a way that the URL will stay as clean as possible.
You shouldn’t let the URL structure limit yourself or your users. If the only real argument param part of this url is the path tot he image, it seems pretty trivial to just join it again: