// Create a new request object
$requestInstance = ObjectFactory::createObjectByName('HttpRequest');
+ // Default response is HTTP (HTML page) and type is "Web"
+ $response = "http";
+ $responseType = "web";
+
+ // Do we have another response?
+ if ($requestInstance->isRequestElementSet('response')) {
+ // Then use it
+ $response = strtolower($requestInstance->getRequestElement('response'));
+ $responseType = $response;
+ } // END - if
+
// ... and a new response object
- $responseInstance = ObjectFactory::createObjectByName('HttpResponse', array($this));
+ $responseInstance = ObjectFactory::createObjectByName(ucfirst($response)."Response", array($this));
// Remember both in this application
$this->setRequestInstance($requestInstance);
} // END - if
// Get a resolver
- $resolverInstance = WebControllerResolver::createWebControllerResolver($commandName, $this);
+ $resolverInstance = ObjectFactory::createObjectByName(ucfirst($responseType)."ControllerResolver", array($commandName, $this));
// Get a controller instance as well
$this->controllerInstance = $resolverInstance->resolveController();