Posted: Sun Oct 02, 2005 5:38 pm
My own FC is just under 100 lines. How'd they get to 100's? I would have thought it a simple enough pattern to implement - unless they're throwing in all but the kitchen sink...
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Ree wrote:I think the FC should be universal enough to accept ALL request data. I guess you could pass the whole $_REQUEST to the front controller. Then from the $_REQUEST 'data soup' it would determine which action should be taken and then some page controller would do its job. Could it be something like that? Or maybe I'm wrong here? I guess you could also pass some Request object instead of $_REQUEST.
I'm really not sure why McGruff didn't dig in ("havent looked at it in detail").. he was a contributor to the discussion there, and the class had tests included. Granted, they don't seem to test every aspect of the code, but I would have thought he would have contributed that as feedback to improve it.dbevfat wrote:I'd actually like to hear an outsider opinion on their FC, so if any of you is willing to take a look at it, you're welcome to share comments.
Unfortunately, it often occurs that a good question doesn't get much followup from the poster. The user in question never posted again, so I'd say its likely that he didn't read the "answer". I could make a snide comment about him not wanting to wade through 16 pages to GET to the answer, but it happens here on a daily basis too - without the 16 pages of high-level discussion.dbevfat wrote:@Roja
You're right, it is more a 'baseline framework for pure OOP development' then a Front Controller. And I understand why it seems funny to you, it actually does to me, too. When I think about it, it was really not a good pointer for a simple FC, even though it could be extracted from their skeleton code ...
I wonder if the original poster of that thread ever got to read it? Did he even bother to read it after 3 posts?
Btw, don't you like DokuWiki, or why did you frown when I mentioned it?
Yes - almost. Strictly speaking a FrontController doesn't hand over to a PageController, although it could be something very like a PageController. They're both input controllers, ie at the top of the tree.Ree wrote:I guess you could pass the whole $_REQUEST to the front controller. Then from the $_REQUEST 'data soup' it would determine which action should be taken and then some page controller would do its job. Could it be something like that?
Does that mean each request by the user must have a GET variable?Typically, the FC is watching one of the GET vars, and can use the value to dynamically invoke a class or lookup a config file (the former being preferred).
The reply was only posted because we have rules against necrothreading.fastfingertips wrote:I think that is not important when this thread has been started, is important what information provides, no matter when this information has been added. You should know better this idea since you are an admin. I also think that you post an useless replay and is hard for me to understand why you post must be viewed by all readers of this area.