// 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 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";
// Walk through all variables
for ($idx = $this->varStack->getIterator(); $idx->valid(); $idx->next()) {
-
// Get current entry
$currEntry = $idx->current();
// Replace all [$var] or {?$var?} with the content
+ //* DEBUG: */ echo "name=".$currEntry['name'].", value=<pre>".htmlentities($currEntry['value'])."</pre>\n";
$content = str_replace("\$content[".$currEntry['name']."]", $currEntry['value'], $content);
$content = str_replace("[".$currEntry['name']."]", $currEntry['value'], $content);
$content = str_replace("{?".$currEntry['name']."?}", $currEntry['value'], $content);
-
} // END - for
// Set the content back
$currVariable = $idx->current();
// Transfer it's name/value combination to the $content array
+ //* DEBUG: */ echo $currVariable['name']."=<pre>".htmlentities($currVariable['value'])."</pre>\n";
$dummy[$currVariable['name']] = $currVariable['value'];
}// END - if
$this->finalizeVariableCompilation();
// Prepare the eval() command for comiling the template
- $eval = sprintf("\$this->setCompiledData(\"%s\");",
+ $eval = sprintf("\$result = \"%s\";",
addslashes($this->getRawTemplateData())
);
// Run the constructed command. This will "compile" all variables in
eval($eval);
+
+ // Set the new content
+ $this->setCompiledData($result);
}
/**