]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/class_ApplicationHelper.php
TemplateEngine is known as WebTemplateEngine (most parts are in BasTemplateEngine...
[shipsimu.git] / application / ship-simu / class_ApplicationHelper.php
index 32bd7649120547a880d2563198ed87353a850153..370bd0223c7284fe4e98fc7888653bffdedcd3b0 100644 (file)
@@ -185,8 +185,19 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                // 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);
@@ -201,7 +212,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                } // 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();