FEATURE: prepare widget for displaying menu on onepage templates
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
namespace Templates\Base\OnePage\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Templates\Base\OnePage\Widgets\OnePageMenu\OnePageMenu;
|
||||
|
||||
class OnePageTemplate extends ServiceProvider
|
||||
{
|
||||
@@ -11,20 +12,46 @@ class OnePageTemplate extends ServiceProvider
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
{ $this->registerTranslations();
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
// register translations
|
||||
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'template');
|
||||
|
||||
// load views
|
||||
$this->loadViewsFrom(array_merge(array_map(function ($path) {
|
||||
return $path;
|
||||
}, \Config::get('view.paths')), [__DIR__ . '/../Resources/views']), 'template');
|
||||
$this->registerViews();
|
||||
$this->registerWidgets();
|
||||
|
||||
// register event service provider for this template
|
||||
$this->app->register(EventProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register translations used in this base template
|
||||
*/
|
||||
private function registerTranslations()
|
||||
{
|
||||
// register translations
|
||||
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'template');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views used in this template - both visitor's and admin's
|
||||
*/
|
||||
private function registerViews()
|
||||
{
|
||||
// load views
|
||||
$this->loadViewsFrom(array_merge(array_map(function ($path) {
|
||||
return $path;
|
||||
}, \Config::get('view.paths')), [__DIR__ . '/../Resources/views']), 'template');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register all widgets related to this template
|
||||
*/
|
||||
private function registerWidgets()
|
||||
{
|
||||
$registrator = $this->app->make('registerWidget');
|
||||
|
||||
// register all available widgets
|
||||
$registrator->register(OnePageMenu::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user