]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/template/class_BaseTemplateEngine.php
Continued:
[core.git] / framework / main / classes / template / class_BaseTemplateEngine.php
index 2460e54cdd9b637894145be3e4bf009e3c93c5f6..fa0be9e4418b657bb69370b3f5652dac0607ec17 100644 (file)
@@ -720,7 +720,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                        $this->loadRawTemplateData($fileInstance);
                } catch (FileNotFoundException $e) {
                        // If we shall load a code-template we need to switch the file extension
-                       if (($this->getTemplateType() != $this->getConfigInstance()->getConfigEntry('html_template_type')) && (empty($extOther))) {
+                       if (($this->getTemplateType() != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('html_template_type')) && (empty($extOther))) {
                                // Switch over to the code-template extension and try it again
                                $ext = $this->getCodeTemplateExtension();
 
@@ -1100,7 +1100,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function loadHtmlTemplate (string $template) {
                // Set template type
-               $this->setTemplateType($this->getConfigInstance()->getConfigEntry('html_template_type'));
+               $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('html_template_type'));
 
                // Load the special template
                $this->loadTemplate($template);
@@ -1187,8 +1187,8 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                $variableName = trim(StringUtils::convertDashesToUnderscores($variableName));
 
                // Sweet and simple...
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: variableName=' . $variableName . ',getConfigEntry()=' . $this->getConfigInstance()->getConfigEntry($variableName));
-               $this->assignVariable($variableName, $this->getConfigInstance()->getConfigEntry($variableName));
+               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: variableName=' . $variableName . ',getConfigEntry()=' . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($variableName));
+               $this->assignVariable($variableName, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($variableName));
        }
 
        /**
@@ -1240,7 +1240,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function loadCodeTemplate (string $template) {
                // Set template type
-               $this->setTemplateType($this->getConfigInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type'));
+               $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type'));
 
                // Load the special template
                $this->loadTemplate($template);
@@ -1255,7 +1255,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function loadEmailTemplate (string $template) {
                // Set template type
-               $this->setTemplateType($this->getConfigInstance()->getConfigEntry('email_template_type'));
+               $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('email_template_type'));
 
                // Load the special template
                $this->loadTemplate($template);
@@ -1289,7 +1289,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE: value='. $value . ',name=' . $currVariable['name'] . ',index=' . $index);
 
                        // Is it a configuration key?
-                       if ($this->getConfigInstance()->isConfigurationEntrySet($value)) {
+                       if (FrameworkBootstrap::getConfigurationInstance()->isConfigurationEntrySet($value)) {
                                // The value itself is a configuration entry
                                $this->assignConfigVariable($value);
                        } else {
@@ -1307,7 +1307,7 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public final function compileVariables () {
                // Initialize the $content array
-               $validVar = $this->getConfigInstance()->getConfigEntry('tpl_valid_var');
+               $validVar = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('tpl_valid_var');
                $dummy = array();
 
                // Iterate through all general variables
@@ -1399,12 +1399,12 @@ abstract class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function compileTemplate () {
                // Get code type to make things shorter
-               $codeType = $this->getConfigInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type');
+               $codeType = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type');
 
                // We will only work with template type "code" from configuration
                if (substr($this->getTemplateType(), 0, strlen($codeType)) != $codeType) {
                        // Abort here
-                       throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
+                       throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
                }
 
                // Get the raw data.