]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/commands/local/class_LocalHomeCommand.php
Footer now added
[shipsimu.git] / inc / classes / main / commands / local / class_LocalHomeCommand.php
index 02f0928f844b7e9e7376d59e6437b0330337ceda..4f96e30cfd0751635b2fc686defadf14a2b6cc92 100644 (file)
@@ -78,6 +78,20 @@ class LocalHomeCommand extends BaseCommand implements Commandable {
                // Load the master template
                $masterTemplate = $appInstance->getMasterTemplate();
 
+               // Load header template
+               $templateInstance->loadCodeTemplate("header");
+
+               // Compile and assign it with a variable
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable("header", "header");
+
+               // Load footer template
+               $templateInstance->loadCodeTemplate("footer");
+
+               // Compile and assign it with a variable
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable("footer", "footer");
+
                // Load the home template
                $templateInstance->loadWebTemplate("home");
 
@@ -87,14 +101,18 @@ class LocalHomeCommand extends BaseCommand implements Commandable {
                // Load the master template
                $templateInstance->loadCodeTemplate($masterTemplate);
 
-               // Compile it...
-               $templateInstance->compileTemplate();
+               // Set title
+               $title = ucfirst($requestInstance->getRequestElement($this->getConfigInstance()->readConfig("command_parameter")));
+               if (empty($title)) $title = "Home";
+               $templateInstance->assignVariable("title", $title);
 
                // ... and all variables. This should be merged together in a pattern
                // to make things easier. A cache mechanism should be added between
                // these two calls to cache compiled templates.
                $templateInstance->compileVariables();
-               die("<pre>".print_r($templateInstance, true)."</pre>");
+
+               // Get the content back from the template engine and put it in the response class
+               $templateInstance->transferToResponse($responseInstance);
        }
 }