mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
c61c3bc608
Allows customization of back-end components via event-driven handling from the theme folder.
35 lines
720 B
PHP
35 lines
720 B
PHP
<?php
|
|
|
|
namespace BookStack\Providers;
|
|
|
|
use BookStack\Theming\ThemeEvents;
|
|
use BookStack\Theming\ThemeService;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class ThemeServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
$this->app->singleton(ThemeService::class, function ($app) {
|
|
return new ThemeService;
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Bootstrap services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
$themeService = $this->app->make(ThemeService::class);
|
|
$themeService->readThemeActions();
|
|
$themeService->dispatch(ThemeEvents::APP_BOOT, $this->app);
|
|
}
|
|
}
|