]> git.mxchange.org Git - hub.git/commitdiff
Also missed this to rename to loadXmlTemplate() :(
authorRoland Häder <roland@mxchange.org>
Wed, 22 Aug 2012 21:20:11 +0000 (21:20 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 22 Aug 2012 21:20:11 +0000 (21:20 +0000)
application/hub/main/tags/package/class_PackageTags.php
application/hub/main/template/class_BaseXmlTemplateEngine.php

index 27b2a0588c43f1a085cdf1d8b035f36f6b01a8ed..0ffd0a59e2fd9433dcfa84978dbbdb7dce105825 100644 (file)
@@ -81,7 +81,7 @@ class PackageTags extends BaseTags implements Tagable {
                $this->setTemplateInstance($templateInstance);
 
                // Read the XML file
-               $this->getTemplateInstance()->loadObjectRegistryTemplate('object_registry');
+               $this->getTemplateInstance()->loadXmlTemplate('object_registry');
 
                // Render the XML content
                $this->getTemplateInstance()->renderXmlContent();
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();