Hi All,
Recently I'm having a hard time thinking of this problem:
Any content-centric website will probably grow to the point that there are many sub categories. For example:
dir_1_level_1/dir_1_level_2/dir_1_level_3/...
/dir_2_level_2...
dir_2_level_2/dir_3_level_2...
I'm thinking whether I should write a php file on each level, storing all related templates there also, or I should write a driver page in the root directory and then load different templates based on the request variables, for example: driverpage.php?page=dir_1_level_1;dir_1_level_2... something like that.
Could anyone give some ideas?
With my best,
Jim
multi level directory design v.s single driver page design
Moderator: General Moderators
- jimthunderbird
- Forum Contributor
- Posts: 147
- Joined: Tue Jul 04, 2006 3:59 am
- Location: San Francisco, CA
- jimthunderbird
- Forum Contributor
- Posts: 147
- Joined: Tue Jul 04, 2006 3:59 am
- Location: San Francisco, CA
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
I think I have been looking at the same issue. There's some articles about BOOTSTRAPPING and front controller which might interest you. I have been asking about this as well in this thread.
At the moment I'm looking into using Arborints PATH_INFO class ideas to try and map url's into different controllers. I know I could use modrewrite, but I'd prefer not to. Because then each time I add a module or page to my website/application, I would have to add another rule to my htaccess file. It should be a matter of just dropping in another action/controller class in some directory. The front controller should, after recieving a request for say /myapp/widgets/show/, look if the controller class widgets exist and hand the request to that controller. Then that controller should use the action show to make the response.
If no appropriate controller and action can be found, the response should go to a general 404-response.
At the moment I'm looking into using Arborints PATH_INFO class ideas to try and map url's into different controllers. I know I could use modrewrite, but I'd prefer not to. Because then each time I add a module or page to my website/application, I would have to add another rule to my htaccess file. It should be a matter of just dropping in another action/controller class in some directory. The front controller should, after recieving a request for say /myapp/widgets/show/, look if the controller class widgets exist and hand the request to that controller. Then that controller should use the action show to make the response.
If no appropriate controller and action can be found, the response should go to a general 404-response.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
You can also use PATH_INFO without mod_rewrite if you build your URLs like this:
Code: Select all
www.mysite.com/index.php/controller/action/value1/value2/(#10850)