We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3c55f3 commit 4fe4867Copy full SHA for 4fe4867
src/Config.php
@@ -62,6 +62,23 @@ public static function attachView($className, $name = null)
62
$class = new $className();
63
$diIndex = $name ?? static::getDiIndex($class);
64
65
+ if (!class_exists('Leaf\Core') && !static::getStatic('views.path') && is_dir('views')) {
66
+ app()->vite();
67
+ app()->config([
68
+ 'views.path' => 'views',
69
+ 'views.cache' => 'cache'
70
+ ]);
71
+
72
+ if ($className === 'Leaf\Blade') {
73
+ $class->configure([
74
+ 'views' => 'views',
75
+ 'cache' => 'cache'
76
77
+ } else if ($className === 'Leaf\BareUI') {
78
+ $class->config('path', './views');
79
+ }
80
81
82
static::set("views.$diIndex", $class);
83
}
84
0 commit comments