Skip to content

Commit

Permalink
Merge pull request #30 from hailwood/feature/absolute-views-folder
Browse files Browse the repository at this point in the history
Allow views folder to be relative to base_path() if it starts with a /
  • Loading branch information
igaster committed May 24, 2016
2 parents 6886058 + 6d3b706 commit 8388216
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ public function set($themeName){
// All paths are relative to Config::get('theme.theme_path')
$paths = [];
do {
// $path = $this->defaultViewsPath[0];
$path = $this->themesPath;
$path .= empty($theme->viewsPath) ? '' : '/'.$theme->viewsPath;
if(substr($theme->viewsPath, 0, 1) === DIRECTORY_SEPARATOR){
$path = base_path(substr($theme->viewsPath, 1));
} else {
$path = $this->themesPath;
$path .= empty($theme->viewsPath) ? '' : DIRECTORY_SEPARATOR . $theme->viewsPath;
}
if(!in_array($path, $paths))
$paths[] = $path;
} while ($theme = $theme->getParent());
Expand Down

0 comments on commit 8388216

Please sign in to comment.