Simplified some code + fixed set/get usage (should be 'get' here).
authorRoland Haeder <roland@mxchange.org>
Mon, 17 Mar 2014 19:55:49 +0000 (20:55 +0100)
committerRoland Haeder <roland@mxchange.org>
Mon, 17 Mar 2014 19:55:49 +0000 (20:55 +0100)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/classes/main/template/class_BaseTemplateEngine.php
inc/classes/main/template/image/class_ImageTemplateEngine.php

index d3fb0d4..8dad7bc 100644 (file)
@@ -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);
index f31f6f0..5608243 100644 (file)
@@ -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());
        }
 
        /**