]> 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 24ef746cf96f7a79e7d79f4d9ec94b510526cd9b..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,8 +101,10 @@ 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