Skip to content

Commit

Permalink
Move theme name inflection into a method
Browse files Browse the repository at this point in the history
This gives the ability to the user to overwrite it to implement his own Inflection
  • Loading branch information
HavokInspiration committed Oct 22, 2015
1 parent ed1b63e commit e4b784c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/View/Helper/UrlHelper.php
Expand Up @@ -153,7 +153,7 @@ public function webroot($file)

if (!empty($this->theme)) {
$file = trim($file, '/');
$theme = Inflector::underscore($this->theme) . '/';
$theme = $this->_inflectThemeName($this->theme) . '/';

if (DS === '\\') {
$file = str_replace('/', '\\', $file);
Expand All @@ -175,6 +175,17 @@ public function webroot($file)
return $webPath . $asset[1];
}

/**
* 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.
*
Expand Down

0 comments on commit e4b784c

Please sign in to comment.