tags:

views:

49

answers:

3

I dont't want to use any framework, but I need a Frontcontroller, Where I can get HELP

Thanks.

+1  A: 
  1. You should configure your mod rewriting. All requests should be go to index.php. And not domain part should be send to the GET parameter. For example: example.com/tratata/tratata. print_r($_GET) should contains 'tratata/tratata';
  2. Create class, which will be explode this GET parameter. It is your FrontController.
  3. Create class tratataController.
  4. Load class by get Parameter.

Sorry for my english.

Alexander.Plutov
You dont need mod_rewrite to implement a FrontController. It's not part of the pattern. That's just something people commonly do. Also, there is no reason that the FrontController has to use PageControllers. Can just as well use Commands only.
Gordon
A: 

Pick a framework and look at the implementation of their FrontController. Figure out how it works and build your own.

That said, why on earth would you not want to use a framework? The only reason I can think of is that you want to know how it works. And for that just google and look at existing sources.

extraneon
A: 

I would recommend building a dynamic invocation front controller. This is what the frameworks use. Here is a link to get started.

http://www.phpwact.org/pattern/front_controller

This book has a great chapter on Presentation Patterns during which he covers the front controller pattern.

PHP Objects, Patterns and Practice, Third Edition (Expert's Voice in Open Source)

http://amzn.to/d3eU0r

LLBBL