Class Dispatcher
Dispatcher to route URI request to appropriate controller / method, and loads view files based on instructions from the controller, passing data setup by the controller from the controller to the view file.
Located in /class.dispatcher.php (line 25)
Determines whether or not the current HTTP request came via AJAX.
Sets up a custom route to match a URI against when dispatching the URI. A custom route is simply run by running a preg_match against the URI, and rewriting it to the replacement on a valid match using preg_replace.
- string $sPattern: The pattern to match against
- string $sReplacement: The string to rewrite to
Routes the specified request to an associated controller and action (class and method).
Loads any specified view file stored in the controller and passes along any data stored in the controller.
This method checks for custom routes first (see AddRoute()), before checking for standard routes. A standard route is a UI formed as follows /[controllername]/[methodname] where [controllername] is the name of the controller, without the word "controller"
A standard controller is named like: ExampleController. To invoke the index method of this controller, one would navigate to /example/index.
The data loaded via the controller's SetData() method is exploded and available for the view file.
- string $sRequest: The current request URI
Internally handles a 404 error, loads the 404 error view file or calls the 404 callback handler if one is defined.
Called from Connect(), responsible for calling the method of the controller routed from the URI
Called from Connect(), responsible for loading any view file
Toggles whether or not the controller should load view files (header, the view setup by the controller, and the footer view file.
- bool $bRequireViewFiles: True if views should be required, false otherwise
Allows the specification of a callback method to invoke upon a 404 error, instead of requiring the 404 view file. If this callback is not callable, nothing will happen on a 404 error.
- callback $xCallback: The callback to invoke upon a 404 error
Sets the name of the view file to load in the event of a 404 error. By default, if no view file is specified, the file the dispatcher will attempt to load is "404.php". The include path will be used to search for this file.
- string $sView: The file name of the view file to load in the event of a 404 error
Sets the name of the footer file to load after loading the controller-specified view file. The default file loaded for the footer is "footer.php." The purpose of this method is to override the default.
Passing null or an empty string, or supplying no argument at all, to this method will cause the dispatcher to not load any footer view file at all.
- string $sView: Optional; The name of the file to load as the footer. Default: none
Sets the name of the header file to load before loading the controller-specified view file. The default file loaded for the header is "header.php." The purpose of this method is to override the default.
Passing null or an empty string, or supplying no argument at all, to this method will cause the dispatcher to not load any header view file at all.
- string $sView: Optional; The name of the file to load as the header. Default: none
Documentation generated on Thu, 25 Feb 2010 15:59:40 -0500 by phpDocumentor 1.4.3

