File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ public function boot(): void
2424 {
2525 // Boot up the theme system
2626 $ themeService = $ this ->app ->make (ThemeService::class);
27+ $ themeService ->registerViewPathsForTheme ($ this ->app ->make ('view ' )->getFinder ());
2728 $ themeService ->readThemeActions ();
2829 $ themeService ->dispatch (ThemeEvents::APP_BOOT , $ this ->app );
2930 }
Original file line number Diff line number Diff line change 88 * Do not edit this file unless you're happy to maintain any changes yourself.
99 */
1010
11- // Join up possible view locations
12- $ viewPaths = [realpath (base_path ('resources/views ' ))];
13- if ($ theme = env ('APP_THEME ' , false )) {
14- array_unshift ($ viewPaths , base_path ('themes/ ' . $ theme ));
15- }
16-
1711return [
1812
1913 // App theme
2620 // Most templating systems load templates from disk. Here you may specify
2721 // an array of paths that should be checked for your views. Of course
2822 // the usual Laravel view path has already been registered for you.
29- 'paths ' => $ viewPaths ,
23+ 'paths ' => [ realpath ( base_path ( ' resources/views ' ))] ,
3024
3125 // Compiled View Path
3226 // This option determines where all the compiled Blade templates will be
Original file line number Diff line number Diff line change 66use BookStack \Exceptions \ThemeException ;
77use Illuminate \Console \Application ;
88use Illuminate \Console \Application as Artisan ;
9+ use Illuminate \View \FileViewFinder ;
910use Symfony \Component \Console \Command \Command ;
1011
1112class ThemeService
@@ -90,6 +91,15 @@ public function readThemeActions(): void
9091 }
9192 }
9293
94+ /**
95+ * Register any extra paths for where we may expect views to be located
96+ * with the provided FileViewFinder, to make custom views available for use.
97+ */
98+ public function registerViewPathsForTheme (FileViewFinder $ finder ): void
99+ {
100+ $ finder ->prependLocation (theme_path ());
101+ }
102+
93103 /**
94104 * @see SocialDriverManager::addSocialDriver
95105 */
You can’t perform that action at this time.
0 commit comments