]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/template/mail/class_MailTemplateEngine.php
imported BaseTemplateEngine
[core.git] / framework / main / classes / template / mail / class_MailTemplateEngine.php
index 109880f2d4981a00faca1924e79332c3860c5021..6fe6f95af8fa68d812b0948c6943b523abb686bc 100644 (file)
@@ -3,11 +3,13 @@
 namespace CoreFramework\Template\Engine;
 
 // Import framework stuff
+use CoreFramework\Filesystem\InvalidDirectoryException;
 use CoreFramework\Mailer\DeliverableMail;
 use CoreFramework\Parser\Xml\XmlParser;
 use CoreFramework\Registry\Registry;
 use CoreFramework\Response\Responseable;
 use CoreFramework\Template\CompileableTemplate;
+use CoreFramework\Template\Engine\BaseTemplateEngine;
 
 // Import SPL stuff
 use \UnexpectedValueException;
@@ -91,7 +93,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Determine base path
-               $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/';
+               $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/';
 
                // Is the base path valid?
                if (empty($templateBasePath)) {
@@ -116,7 +118,10 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension'));
 
                // Absolute output path for compiled templates
-               $templateInstance->setCompileOutputPath($templateInstance->getConfigInstance()->getConfigEntry('base_path') . $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path'));
+               $templateInstance->setCompileOutputPath(sprintf('%s%s/',
+                       $templateBasePath,
+                       $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')
+               ));
 
                // Return the prepared instance
                return $templateInstance;