// 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");
// 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);
}
}