Class WFRequestController

Description

The RequestController object is a singleton controller for the entire request-act-respond cycle.

Basically, the WFRequestController bootstraps the request into a WFModuleInvocation, executes it, and displays the output.

It also has a top-level exception catcher for all uncaught exceptions and displays a friendly error message (or an informative one for development machines).

Located in /framework/WFRequestController.php (line 18)

WFObject
   |
   --WFRequestController
Variable Summary
Method Summary
static object The sharedRequestController ()
static object A sharedSkin ()
static string WFURL (string $moduleName, [string $pageName = NULL])
WFRequestController __construct ()
void handleException ( $e)
boolean isAjax ()
object The rootModuleInvocation ()
Variables
object The $rootModuleInvocation (line 23)
  • var: root WFModuleInvocation object used for the request.
  • access: protected
Methods
static method sharedRequestController (line 212)

Get a reference to the shared WFRequestController object.

  • return: WFRequestController object.
  • access: public
static object The sharedRequestController ()
static method sharedSkin (line 180)

Get a reference to this WFRequestController's skin object.

  • return: reference to the WFSkin object.
  • deprecated: Use $module->rootSkin()
  • access: public
static object A sharedSkin ()
static method WFURL (line 199)

Generate a "full" URL to the given module / page.

It is recommended to use this function to generate all URL's to pages in the application. Of course you may append some PATH_INFO or params afterwards.

  • return: a RELATIVE URL to the requested module/page.
  • access: public
static string WFURL (string $moduleName, [string $pageName = NULL])
  • string $moduleName: The module name (required).
  • string $pageName: The page name (or NULL to use the default page).
Constructor __construct (line 25)
WFRequestController __construct ()

Redefinition of:
WFObject::__construct()
handleException (line 38)

Exception handler for the WFRequestController.

This is basically the uncaught exception handler for the request cycle. We want to have this in the request object because we want the result to be displayed within our skin system. This function will display the appropriate error page based on the deployment mode for this machine, then exit.

void handleException ( $e)
  • Exception $e: The exception object to handle.
handleHTTPRequest (line 98)

Run the web application for the current request.

NOTE: Both a module and page must be specified in the URL. If they are not BOTH specified, the server will REDIRECT the request to the full URL. Therefore, you should be sure that when posting form data to a module/page, you use a full path. WFRequestController::WFURL

Will pass control onto the current module for processing.

Create a WFModuleInvocation based on the current HTTP Request, get the results, and output the completed web page.

  • todo: Handle 404 situation better -- need to be able to detect this nicely from WFModuleInvocation.. maybe an Exception subclass?
  • todo: PATH_INFO with multiple params, where one is blank, isn't working correctly. IE, /url/a//c gets turned into /url/a/c for PATH_INFO thus we skip a "null" param. NOTE: Partial solution; use /WFNull/ to indicate NULL param instead of // until we figure something out. NOTE: Recent change to REQUEST_URI instead of PATH_INFO to solve decoding problem seems to have also solved the // => / conversion problem... test more! WORRY: That the new PATH_INFO calculation will fail when using aliases other than WWW_ROOT. IE: /products/myProduct might break it...
void handleHTTPRequest ()
isAjax (line 155)

Is the current request an XHR (XmlHTTPRequest)?

boolean isAjax ()
rootModuleInvocation (line 168)

Get the root WFModuleInvocation used by the request controller.

  • return: root WFModuleInvocation for the page.
object The rootModuleInvocation ()

Inherited Methods

Inherited From WFObject

WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::setValuesForKeys()
WFObject::validatedSetValueForKey()
WFObject::validatedSetValueForKeyPath()
WFObject::validateObject()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForStaticKey()
WFObject::valueForStaticKeyPath()
WFObject::valueForTargetAndKeyPath()
WFObject::valueForUndefinedKey()
WFObject::valueForUndefinedStaticKey()
WFObject::valuesForKeyPaths()
WFObject::valuesForKeys()
WFObject::_valueForStaticKey()
WFObject::__toString()

Documentation generated on Thu, 14 May 2009 16:20:22 -0400 by phpDocumentor 1.4.2