Page 1 of 1

Regarding the Front Controller pattern

Posted: Tue Mar 21, 2006 4:42 am
by fastfingertips
In my current application i'm planning to implement a Front Controller pattern and Page Cotroller. If the PC is obvious for me i have some problems with the Front Controller.

I'm using mod_rewrite to have SEO urls, now in a file i set this paramateres but i'm afraid that i don't understand very well what to put in the dispatcher or how it is working. Can you advice me please about?

Posted: Tue Mar 21, 2006 4:53 pm
by Christopher
Controllers are a complex subject. Starting off with the fact that Front Controller pattern and Page Controller pattern are exclusive -- so you can't have both at the same time. The controllers that are dispatched by a Front Controller looks like a cleaned up Page Controllers but it's not Page Controllers. I usually use the generic term Input Controller for those dispatched controllers. The details and terminology are endless with controller design.

Here is a bunch of code that came out of several long threads about controllers as Sitepoint. You can download it here. It has a bunch of controller examples and the classes around them needed for support. There is a PathInfoMapper example for clean URLs. The code is not a framework, just a example skeleton to show ideas -- but it does work.