From fd44a6f6ad63d5e429fb9082d54a69448af024b9 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 17 Mar 2014 20:55:49 +0100 Subject: [PATCH] Simplified some code + fixed set/get usage (should be 'get' here). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/classes/main/template/class_BaseTemplateEngine.php | 10 ++-------- .../main/template/image/class_ImageTemplateEngine.php | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index d3fb0d41..8dad7bc0 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -725,14 +725,11 @@ class BaseTemplateEngine extends BaseFrameworkSystem { * @return void */ private function loadRawTemplateData ($fqfn) { - // Get a input/output instance from the middleware - $ioInstance = $this->getFileIoInstance(); - // Some debug code to look on the file which is being loaded //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: FQFN=' . $fqfn); // Load the raw template - $rawTemplateData = $ioInstance->loadFileContents($fqfn); + $rawTemplateData = $this->getFileIoInstance()->loadFileContents($fqfn); // Store the template's contents into this class $this->setRawTemplateData($rawTemplateData); @@ -1439,13 +1436,10 @@ class BaseTemplateEngine extends BaseFrameworkSystem { * @return void */ protected function loadViewHelper ($helperName) { - // Make first character upper case, rest low - $helperName = $this->convertToClassName($helperName); - // Is this view helper loaded? if (!isset($this->helpers[$helperName])) { // Create a class name - $className = $helperName . 'ViewHelper'; + $className = $this->convertToClassName($helperName) . 'ViewHelper'; // Generate new instance $this->helpers[$helperName] = ObjectFactory::createObjectByName($className); diff --git a/inc/classes/main/template/image/class_ImageTemplateEngine.php b/inc/classes/main/template/image/class_ImageTemplateEngine.php index f31f6f04..56082432 100644 --- a/inc/classes/main/template/image/class_ImageTemplateEngine.php +++ b/inc/classes/main/template/image/class_ImageTemplateEngine.php @@ -460,7 +460,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl */ public function getImageCacheFqfn () { // Get the FQFN ready - $fqfn = sprintf("%s%s%s/%s.%s", + $fqfn = sprintf('%s%s%s/%s.%s', $this->getConfigInstance()->getConfigEntry('base_path'), $this->getGenericBasePath(), 'images/_cache', @@ -482,7 +482,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl */ public function transferToResponse (Responseable $responseInstance) { // Set the image instance - $responseInstance->setImageInstance($this->getImageInstance()); + $responseInstance->getImageInstance($this->getImageInstance()); } /** -- 2.39.5