X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fship-simu%2Fclass_ApplicationHelper.php;h=32bd7649120547a880d2563198ed87353a850153;hb=4c35e8280767c1e33832097060e39a32b80ffd01;hp=ef2de33ecda7290a372b2d818506f42b2282ff5f;hpb=55b327a3f5f2fe1d244532e07be7444e94b2a768;p=shipsimu.git diff --git a/application/ship-simu/class_ApplicationHelper.php b/application/ship-simu/class_ApplicationHelper.php index ef2de33..32bd764 100644 --- a/application/ship-simu/class_ApplicationHelper.php +++ b/application/ship-simu/class_ApplicationHelper.php @@ -69,6 +69,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica * An instance of this class */ private static $thisInstance = null; + /** * Protected constructor * @@ -185,24 +186,25 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica $requestInstance = ObjectFactory::createObjectByName('HttpRequest'); // ... and a new response object - $responseInstance = HttpResponse::createHttpResponse($this); + $responseInstance = ObjectFactory::createObjectByName('HttpResponse', array($this)); - // Get command parameter - $commandPara = $this->getConfigInstance()->readConfig('command_parameter'); + // Remember both in this application + $this->setRequestInstance($requestInstance); + $this->setResponseInstance($responseInstance); // Get the parameter from the request - $commandName = $requestInstance->getRequestElement($commandPara); + $commandName = $requestInstance->getRequestElement('page'); // If it is null then get default command if (is_null($commandName)) { $commandName = $this->getConfigInstance()->readConfig('default_command'); - } + } // END - if // Get a resolver $resolverInstance = WebControllerResolver::createWebControllerResolver($commandName, $this); // Get a controller instance as well - $this->controllerInstance = $resolverInstance->resolveCommandController(); + $this->controllerInstance = $resolverInstance->resolveController(); // Handle the request $this->controllerInstance->handleRequest($requestInstance, $responseInstance);