FEATURE #1453: add registration of templates
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Handlers\Registrators\TemplateRegistrator;
|
||||
use App\Handlers\Registrators\WidgetRegistrator;
|
||||
use App\Widgets\HtmlCode\HtmlCode;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
@@ -16,6 +17,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
public function boot()
|
||||
{
|
||||
$this->registerWidgets();
|
||||
$this->registerTemplates();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,6 +40,11 @@ class AppServiceProvider extends ServiceProvider
|
||||
$this->app->singleton('registerWidget', function ($app) {
|
||||
return new WidgetRegistrator($app);
|
||||
});
|
||||
|
||||
// create registrator for template directories
|
||||
$this->app->singleton('registerTemplateDir', function ($app) {
|
||||
return new TemplateRegistrator($app);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,4 +60,18 @@ class AppServiceProvider extends ServiceProvider
|
||||
// register all available widgets
|
||||
$registrator->register(HtmlCode::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register path with editable contents
|
||||
*/
|
||||
private function registerTemplates()
|
||||
{
|
||||
/**
|
||||
* @var $registrator TemplateRegistrator
|
||||
*/
|
||||
$registrator = $this->app->make('registerTemplateDir');
|
||||
$registrator->setBaseDirectory('resources/views/visitor');
|
||||
|
||||
$registrator->register(config('app.theme'), trans('admin/templates.core'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user