Browse Source

Merge pull request #7597 from HavokInspiration/theme-inflection

Move theme name inflection into a method
ADmad 10 years ago
parent
commit
405592869b
1 changed files with 12 additions and 1 deletions
  1. 12 1
      src/View/Helper/UrlHelper.php

+ 12 - 1
src/View/Helper/UrlHelper.php

@@ -153,7 +153,7 @@ class UrlHelper extends Helper
 
         if (!empty($this->theme)) {
             $file = trim($file, '/');
-            $theme = Inflector::underscore($this->theme) . '/';
+            $theme = $this->_inflectThemeName($this->theme) . '/';
 
             if (DS === '\\') {
                 $file = str_replace('/', '\\', $file);
@@ -176,6 +176,17 @@ class UrlHelper extends Helper
     }
 
     /**
+     * Inflect the theme name to its underscored version.
+     *
+     * @param string $name Name of the theme which should be inflected.
+     * @return string Inflected name of the theme
+     */
+    protected function _inflectThemeName($name)
+    {
+        return Inflector::underscore($name);
+    }
+
+    /**
      * Event listeners.
      *
      * @return array