mirror of
https://github.com/getgrav/grav.git
synced 2026-07-04 12:49:06 +02:00
Add support for themes to return instantiated Theme object
This commit is contained in:
committed by
Djamil Legato
parent
84acaaea80
commit
1e8542da9c
@@ -83,12 +83,14 @@ class Themes
|
||||
|
||||
$file = THEMES_DIR . "{$name}/{$name}.php";
|
||||
if (file_exists($file)) {
|
||||
require_once $file;
|
||||
$class = require_once $file;
|
||||
|
||||
$className = '\\Grav\\Theme\\' . ucfirst($name);
|
||||
if (!is_object($class)) {
|
||||
$className = '\\Grav\\Theme\\' . ucfirst($name);
|
||||
|
||||
if (class_exists($className)) {
|
||||
$class = new $className;
|
||||
if (class_exists($className)) {
|
||||
$class = new $className;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user