I\'ve been struggling for some time now with exactly how to recode a page-based PHP application using an MVC framework. Just for background, I am having to move the app into MVC
I also still have some issues of when to make that decision to use a controller instead of an action. A good example would be this stackoverflow website. At the top of the page, you have a "Questions" selection which we could assume takes you to the "questions" controller. I say this, because on the right hand side you can choose to "Ask a question" which the URL points to "questions/ask". So that makes sense that your using the ask method of the questions controller.
Well, we don't know if "ask" is an action of the "questions" controller. This site could be routing the "questions/ask" url to a different controller, or "ask" could be a controller in a "questions" directory. Also, if you bring up the "questions/ask" page, you'll notice the form gets posted to "questions/ask/post". Now "post" could be a parameter for the "ask" action method, but I'd guess it is a "post" action method of an "ask" controller.
Who knows. But please consider this: The "Questions" page would require several times more code than the "Ask Question" page. Would it make sense to load the "Questions" page code when loading the "Ask Question" page. I'd think the stackoverflow guys would be smarter than that.
But what confuses me, is then you have the "Unanswered" option on the menu. It looks like this has a controller to itself. Why wouldn't it just be an action under the questions controller? As in "questions/unanswered"? That's where things become muddy for me.
Another reason why I think the "Ask Question" page has its own controller. The "Questions" page has much more in common with the "Unanswered" page.