FEATURE: add blade template registration into templates

This commit is contained in:
Michal Kváček
2016-09-20 11:50:41 +02:00
parent f087da1b43
commit d43073a011
17 changed files with 191 additions and 108 deletions
@@ -57,30 +57,14 @@ class StaticPagesServiceProvider extends ServiceProvider
*/
public function registerViews()
{
$viewPath = base_path('resources/views/modules/staticpages');
$sourcePath = __DIR__ . '/../Resources/views';
$viewPath = base_path('resources/views/modules/staticpages');
$this->publishes([$sourcePath => $viewPath], 'module-views');
$this->loadViewsFrom(array_merge(array_map(function ($path) {
return $path . '/modules/staticpages';
}, \Config::get('view.paths')), [$sourcePath]), 'staticpages');
/**
* @var $registrator TemplateRegistrator
*/
$registrator = $this->app->make('registerTemplateDir');
// try {
// // setup some global variables
// $registrator->setBaseDirectory('resources/views/modules/staticpages/visitor');
// $registrator->setNamespace('staticpages');
// $registrator->setModuleId(call_user_func([config('staticpages.handler'), 'getModuleId']));
//
// // register path with current template name
// $registrator->register(config('app.theme'), 'staticpages::admin.templatePath');
// } catch (InvalidArgumentException $e) {
// // ignore this exception
// }
}
/**