mirror of
https://github.com/getgrav/grav.git
synced 2026-02-22 06:28:03 +01:00
Merge pull request #433 from Sommerregen/patch-3
Fixes #432 (Theme autoloading doesn't seem to work)
This commit is contained in:
@@ -284,11 +284,11 @@ class Themes extends Iterator
|
||||
$class = substr($class, strlen($prefix));
|
||||
|
||||
// Replace namespace tokens to directory separators
|
||||
$path = ltrim(preg_replace('#\\\|_(?!.+\\\)#', '/', $class), '/');
|
||||
$path = strtolower(ltrim(preg_replace('#\\\|_(?!.+\\\)#', '/', $class), '/'));
|
||||
$file = $locator->findResource("themes://{$path}/{$path}.php");
|
||||
|
||||
// Load class
|
||||
if (stream_resolve_include_path($file)) {
|
||||
if (file_exists($file)) {
|
||||
return include_once($file);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user