By: Allex Gervasio
Hey Les, Thanks for the kind comments. In a wider view, the dispatcher is actually responsible for encapsulating the instantiation of the page controller, only that in this case the task is performed...
View ArticleBy: Boabramah Ernest
@Les Yes me too was thinking the same thing. The dispatcher could just request the name of the controller from the router. But as he said in the closing remark,which one you pick up depends exclusively...
View ArticleBy: Marten
One advantage of the ‘second’ implementation of the Front controller is that you easily can use it like a HMVC framework. :) nice article!
View ArticleBy: Alex Gervasio
Thanks Marten for the positive comments. Yes, you’re correct regarding the front controller’s modularity would allow you to get a nice HMVC implementation up and running with minor hassles. I’m not a...
View ArticleBy: Alex Gervasio
Actually, I’m not saying that you can’t build a HMVC stack at all. Just I don’t like to deal with chained controllers, MVC triads and the related stuff. In either case, if you’re interested in tweaking...
View ArticleBy: Stefan
Hi, this is a great article. Very helpful to me. Do you also provide the script for download?
View ArticleBy: Alex Gervasio
Hey Stefan, Glad to know the post has been instructive. Unfortunately, in this case I can’t please you and provide you with a straight download of the source files, cause I conceived the article pretty...
View ArticleBy: Kevin
Are other .htaccess files required in the other directories? Or just one in the root? I ask since CakePHP has 3, one each at different folders.
View ArticleBy: Alex Gervasio
Hey Kev, Just to make things a little bit clear, you only need one .htaccess file to get the whole request/route/dispatch/response cycle up and running. From that point onward, if you pass along to the...
View ArticleBy: Kevin
I get this error when i turn on error handling: Fatal error: Class ‘Acme\Library\Loader\Autoloader’ not found in (path) So I try adding this line to index.php: use...
View ArticleBy: Alex Gervasio
You need to include the autoloader in your index.php file before registering it in the SPL stack. Again, make sure to copy the code exactly as appears in the article’s last code sample. Just do so and...
View ArticleBy: Kevin
Got it working. Whew! Thanks for your help Alex. If I set up multiple controllers to handle different tasks, do I now need to specify them in the index.php using: $request = new Request( … ); $response...
View ArticleBy: Alex Gervasio
Glad to hear that. Now, about your questions: 1) “If I set up multiple controllers to handle different tasks, do I now need to specify them in the index.php using: $request = new Request( … );...
View ArticleBy: Kevin
I completely agree with you on MVC approach. #2: suppose i want to build an app that needs to display pages but some URIs will process ajax data. Would i need to add all possibilities to the index.php?...
View ArticleBy: Alex Gervasio
Keep in mind that index.php is just a centralized point where your front controller resides. Based on that schema, you’re free to use it for routing/dispatching requests to the appropriate action...
View Article