I think I get the basic concepts of MVC, but I’m not sure where I should put my “home page”? By that I mean for example the page that would come up if you navigated to stackoverflow.com rather than something like stackoverflow.com/questions which has an obvious controller attached (the “questions” controller).
I have a function which determines what controller to use based on a GET variable, but I’m not quite sure what do do when that variable is missing. I was thinking of adding a define() for like a “default path” but I’m not sure what to use. The main page will fall in a category of pages, but will be its own separte entity. To use stackoverflow as the example, I could route the front page to the ‘questions” controller, but don’t know what to use as an action. “questions/frontpage” seems like a bad name to me.
Its odd, but I don’t see this covered in any MVC tutorial online.
You would use a home controller, generally.
If you have basic routing set up in a bootstrap type file, just point a blank
$_SERVER['REQUEST_URI']or similar to your home controller.