PHPLights/Documentation/Front Controller

From Linuxnetworks
< PHPLights‎ | Documentation
Revision as of 15:42, 16 September 2007 by Nose (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Applications based on PHPLights provide a single entry for all pages through their index.php file in the application directory. It starts up the library core which initializes the basic library components and sets up class autoloading.

Afterwards, the dispatcher forwards the request to the appropriate controller and action method. Controller, action and parameter are given via the URL, e.g.

index.php/default/index/2007/print

would specify the controller "default", the action "index" and the parameters "2007" and "print". The first two parameter after "index.php" are mapped the "index" method in the "DefaultController" class. All other parameter are available as numerically indexed array via the get() function of the request class:

$req = LsContext::getRequest()
$list = $req->get('ls/param', array(), $regex );

Controller class and its methods must be implemented by the application and contains the business logic necessary to fulfill the request.



Back to Overview