$this->setTemplateInstance($templateInstance);
// Read the XML file
- $this->getTemplateInstance()->loadObjectRegistryTemplate('object_registry');
+ $this->getTemplateInstance()->loadXmlTemplate('object_registry');
// Render the XML content
$this->getTemplateInstance()->renderXmlContent();
/**
* Load a specified XML template into the engine
*
+ * @param $templateName Optional name of template
* @return void
*/
- public function loadXmlTemplate () {
+ public function loadXmlTemplate ($templateName = '') {
+ // Is the template name empty?
+ if (empty($templateName)) {
+ // Set generic template name
+ $templateName = $this->typePrefix . '_' . $this->xmlTemplateType . '_template_type';
+ } // END - if
+
// Set template type
- $this->setTemplateType($this->getConfigInstance()->getConfigEntry($this->typePrefix . '_' . $this->xmlTemplateType . '_template_type'));
+ $this->setTemplateType($this->getConfigInstance()->getConfigEntry($templateName));
// Load the special template
$this->loadTemplate($this->xmlTemplateType);
// Get a temporay template instance
$templateInstance = XmlTemplateEngineFactory::createXmlTemplateEngineInstance($this->typePrefix . '__' . $this->xmlTemplateType . '_template_class');
- // Create method name
- $methodName = 'load' . $this->convertToClassName($this->xmlTemplateType) . 'Template';
-
// Then load it
- call_user_func(array($templateInstance, $methodName), $templateDependency);
+ $templateInstance->loadXmlTemplate($templateDependency);
// Parse the XML content
$templateInstance->renderXmlContent();