Jump to content

bootstrapping, how to parse request_uri


mikeken

Recommended Posts

Hi all,

 

I am creating a small custom php mvc framework that I can re-use in all of my projects.

 

So assuming that I am getting a request_uri of /customframework/aboutus how would I "parse" that in php to extract the aboutus or whatever else it might be from the string?

 

Also, is there a good way to ignore any trailing slashes if there are any? For example, if the request_uri was /customframework/aboutus/// I would still want to know just the aboutus in a string

 

Thanks!

Link to comment
Share on other sites

There can be a fair bit more to it than simply parsing the url for different segments. It's not exactly something that would be easily described within a simple forum post.

 

I would take a look at some of the other frameworks and in particular there routing. If your looking for something simple to use as an example, my framework (Proem) linked to via the Github link in my signature has a fairly basic routing system (still incomplete).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.