]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/template/class_BaseXmlTemplateEngine.php
Also missed this to rename to loadXmlTemplate() :(
[hub.git] / application / hub / main / template / class_BaseXmlTemplateEngine.php
index 58b990edc68300cb5d10efb2dba8a772df8c90f4..761dd62b502a15790aad95e9daef0deeff7ee0f4 100644 (file)
@@ -129,11 +129,18 @@ class BaseXmlTemplateEngine extends BaseTemplateEngine {
        /**
         * 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);
@@ -204,11 +211,8 @@ class BaseXmlTemplateEngine extends BaseTemplateEngine {
                        // 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();