Quick search:

Request dispatch

Instead of having a different .php file for every page, we have a central entry point for the application. This entry point dispatches the request according to the values of parameters from the url or form. For an explanation of the parameters see how to asssemble a hyperlink or form.

First an attempt is made to find a specific handler class for the type of objects that are to be shown. (A special case is made for specializing the property pages for each property individually)

$type = $requestData["pntType"];
$handler = $requestData["pntHandler"];
if ($handler=='PropertyPage') { //special case
 $property = ucFirst($requestData["pntProperty"]);
 $handler = "Property$property".'Page';
}
$handlerClass = "$type$handler"; 

For including the handlerClass first an attempt is made to include a class file from the application directory:
tryIncludeClass($handlerClass , $dir);
if no success, a class from the classes directory is tried:
 tryIncludeClass($handlerClass , '');

If all this fails a generic handler class is used:
$handlerClass = "Object$handler";
(tryIncludeClass....)

If there is no pntHandler parameter an appropriate pntHandler is selected:
if ($id !== null)
 $handler = 'EditDetailsPage';
else
 $handler = 'IndexPage';

If no handlerClass can be included, ErrorPage is used, which of course should always be there.

(The real getRequestHandler method is a bit more complicated because of the creation of error messages that explain what happened).