Skip to content

Commit 8388216

Browse files
committed
Merge pull request #30 from hailwood/feature/absolute-views-folder
Allow views folder to be relative to base_path() if it starts with a /
2 parents 6886058 + 6d3b706 commit 8388216

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Themes.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,12 @@ public function set($themeName){
7777
// All paths are relative to Config::get('theme.theme_path')
7878
$paths = [];
7979
do {
80-
// $path = $this->defaultViewsPath[0];
81-
$path = $this->themesPath;
82-
$path .= empty($theme->viewsPath) ? '' : '/'.$theme->viewsPath;
80+
if(substr($theme->viewsPath, 0, 1) === DIRECTORY_SEPARATOR){
81+
$path = base_path(substr($theme->viewsPath, 1));
82+
} else {
83+
$path = $this->themesPath;
84+
$path .= empty($theme->viewsPath) ? '' : DIRECTORY_SEPARATOR . $theme->viewsPath;
85+
}
8386
if(!in_array($path, $paths))
8487
$paths[] = $path;
8588
} while ($theme = $theme->getParent());

0 commit comments

Comments
 (0)