News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
An Introduction to the Front Controller Pattern, Part 1
July 31, 2012 @ 13:31:12

If you've done any work with PHP frameworks, the concept of a "front controller" should be a familiar one. If you haven't, the idea might be new to you and PHPMaster.com has started off a series that will introduce you to the basics of the Front Controller design pattern in a few different parts.

Some are now grumbling about newer concepts that have recently made inroads in day-to-day PHP development, saying Front Controllers are a redundant "reinvention of the wheel" which should be discarded ipso facto. [...] In this two-part article I'll be exploring in depth a couple of straightforward approaches that you might find appealing, especially if you're trying to implement an expandable front controller from scratch without sweating excessively during the process or having to cope with the burdens of a bloated framework.

This first part of the series introduces you to some of the basic concepts of routing and URL handling and shares the code for a basic front controller. It parses the URL and sets up the controller and action to hand the request off to. Also included is the contents for the .htaccess file you'll need to include to route all requests back through this controller instance.

0 comments voice your opinion now!
frontcontroller designpattern introduction routing controller action


blog comments powered by Disqus

Similar Posts

CodeSnipers.com: Stupidly Easy MVC - Group Membership Application (Part 2)

PHPit.net: Using the CURL Library on PHP

KillerPHP.com: PHP Design Patterns - when should they be used?

TutsWall.com: CodeIgniter from scratch - Introduction & Installation

SitePoint PHP Blog: Building a Simple Blog App with MongoDB and PHP


Community Events

Don't see your event here?
Let us know!


interview series example opinion voicesoftheelephpant framework symfony2 release api application community performance part2 language podcast configure conference laravel php7 introduction

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework