I am working on a new social network type app in PHP. I am wanting to do it all in OO and I do not want to use an existing framework.
I have been studying many different frameworks and libraries to see how they do things like MVC.
So far what I have is something like this...
// All request are routed through index.php
// index.php
Get requested page from URI (ie; test.com/user/friends/page-12 )
$controller = User();
$controller_method = friends();
$page = 12; // for paging results
$id = ''; //id is empty in this example but some pages will have an ID number as well
So in theory I would load a User class and friends() method. This all sounds simple and great on a basic site but what I am building will be more complex so I am not sure exactly what I should do next. For example on some pages, I will require that a user is authorized already.
So instead of loading a User class and friends method, should I be including a user friends file instead where I can have more stuff happening? In this case it would load a user file and that file could call user class methods as well as set up paging and do authentication and other things that should be on that page.
Another idea, since this example is calling the user class, what is the user class has methods friends() , profile(), settings() and these methods when called basicly just route to include another file with that will have the main content for that page? Sorry if this is confusing