]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/class_ApplicationHelper.php
home command now loads its template into the master template
[shipsimu.git] / application / ship-simu / class_ApplicationHelper.php
index ff8fe5e76d9e71f489330f634aa1bfa50b849a7f..07aeffc472da90c32959f7e8547ea59496778718 100644 (file)
@@ -55,6 +55,11 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
         */
        private $shortName = "";
 
+       /**
+        * The name of the master template
+        */
+       private $masterTemplate = "shipsimu_main";
+
        /**
         * An instance of this class
         */
@@ -97,7 +102,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
        /**
         * Getter for the version number
         *
-        * @return      $appVersion     The application's version number
+        * @return      $appVersion             The application's version number
         */
        public final function getAppVersion () {
                return $this->appVersion;
@@ -106,7 +111,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
        /**
         * Setter for the version number
         *
-        * @param       $appVersion     The application's version number
+        * @param       $appVersion             The application's version number
         * @return      void
         */
        public final function setAppVersion ($appVersion) {
@@ -157,23 +162,35 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                $this->shortName = $shortName;
        }
 
+       /**
+        * Getter for master template name
+        *
+        * @return      $masterTemplate         Name of the master template
+        */
+       public final function getMasterTemplate () {
+               return $this->masterTemplate;
+       }
+
        /**
         * Launches the ship-simulator game
         *
         * @return      void
         */
        public final function entryPoint () {
-               // Handle the request
-               $this->handleRequest();
+               // Get default command
+               $defaultCommand = $this->getConfigInstance()->readConfig("default_command");
 
-               // Prepare the template engine
-               $tplEngine = $this->prepareTemplateEngine($this);
+               // Create a new request object
+               $requestInstance = HttpRequest::createHttpRequest();
 
-               // Load the main template
-               $tplEngine->loadCodeTemplate("shipsimu_main");
+               // ... and a new response object
+               $responseInstance = HttpResponse::createHttpResponse($this);
 
-               // Raise an error here
-               trigger_error(__METHOD__.": Unfinished work!");
+               // Get a new controller instance as well
+               $controllerInstance = LocalControllerResolver::createLocalControllerResolver($defaultCommand, $this)->resolveDefaultController();
+
+               // Handle the request
+               $controllerInstance->handleRequest($requestInstance, $responseInstance);
        }
 }