Jump to content

Simple MVC help


moon 111

Recommended Posts

This is the problem:

 

The router takes the end of the url and uses it to choose the correct controller. If the url is '/members/view' it includes the the page members.php which contains the class Controller_Members, creates and instance of it and calls the function view. If it were only '/members/' it would call the function 'index'. The problem is if I want to view a specific user. My idea is to take the extra things in the url (if any) and pass them as arguments so if its '/members/view/143' it will pass 143 as an argument to 'view'. Is this a good idea?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/101572-simple-mvc-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.