X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Ftemplate%2Fweb%2Fclass_WebTemplateEngine.php;h=7e4a6ef1f50ec909aaa96e66b68dbf4148743680;hp=6033ef59d69cd2448f39d7ba03d719ea66312d64;hb=1ee35e6d96c456b8e3499bd683f1647aa28bd501;hpb=4b88c118b615335d06bd74e444173d21aef4406c diff --git a/inc/classes/main/template/web/class_WebTemplateEngine.php b/inc/classes/main/template/web/class_WebTemplateEngine.php index 6033ef59..7e4a6ef1 100644 --- a/inc/classes/main/template/web/class_WebTemplateEngine.php +++ b/inc/classes/main/template/web/class_WebTemplateEngine.php @@ -3,11 +3,11 @@ * The own template engine for loading caching and sending out the web pages * and emails. * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2014 Core Developer Team * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.shipsimu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,8 +36,7 @@ class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplat /** * Creates an instance of the class TemplateEngine and prepares it for usage * - * @param $appInstance A manageable application - * @return $templateInstance An instance of TemplateEngine + * @return $templateInstance An instance of TemplateEngine * @throws BasePathIsEmptyException If the provided $templateBasePath is empty * @throws InvalidBasePathStringException If $templateBasePath is no string * @throws BasePathIsNoDirectoryException If $templateBasePath is no @@ -45,16 +44,15 @@ class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplat * @throws BasePathReadProtectedException If $templateBasePath is * read-protected */ - public static final function createWebTemplateEngine (ManageableApplication $appInstance) { + public static final function createWebTemplateEngine () { // Get a new instance $templateInstance = new WebTemplateEngine(); - // Get language and file I/O instances from application - $langInstance = $appInstance->getLanguageInstance(); - $ioInstance = $appInstance->getFileIoInstance(); + // Get the application instance from registry + $applicationInstance = Registry::getRegistry()->getInstance('app'); // Determine base path - $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $appInstance->getRequestInstance()->getRequestElement('app') . '/'; + $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; // Is the base path valid? if (empty($templateBasePath)) { @@ -74,10 +72,6 @@ class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplat // Set the base path $templateInstance->setTemplateBasePath($templateBasePath); - // Set the language and IO instances - $templateInstance->setLanguageInstance($langInstance); - $templateInstance->setFileIoInstance($ioInstance); - // Set template extensions $templateInstance->setRawTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('raw_template_extension')); $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension'));