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
+1 -1
View File
@@ -5,6 +5,6 @@ return [
'alias' => 'sablona',
'description' => 'Sablona jednostrankova',
'files' => [
'routes.php'
__DIR__.'/routes.php'
]
];
+4 -3
View File
@@ -1,6 +1,7 @@
<?php
Route::group(['middleware' => 'web', 'prefix' => 'test', 'namespace' => 'Modules\Blog\Comments\Http\Controllers'], function()
Route::group(['middleware' => 'web', 'prefix' => 'test'], function()
{
Route::get('/neco-neco', 'CommentsController@index')->name('template.route');
Route::get('/', function() {
echo "ahoj";
})->name('template.route');
});
+51
View File
@@ -0,0 +1,51 @@
<?php
namespace Templates\Jednostrankovka;
use App\Models\Module;
use App\Models\User;
use Templates\Base\OnePage\Handlers\OnePage;
class Handler extends OnePage
{
/**
* Register admin menu (or multiple ones)
*
* This cannot be in ServiceProvider because Session is started at middleware. And ServiceProvider is called before
* starting any middleware..
*
* @param User $user model of logged user
*/
public static function registerAdminMenu(User $user)
{
// parent::registerAdminMenu($user);
}
/**
* Install module
*
* @return mixed
*/
public static function install()
{
// parent::install();
}
public static function uninstall(Module $template)
{
// parent::uninstall($template);
}
public static function getPublicTemplatePaths()
{
return [
[
'module' => 'Article',
'templateName' => 'article::templates.name'
],
[
'module' => 'StaticPages',
'templateName' => 'staticpages::templates.name'
]
];
}
}
@@ -0,0 +1 @@
{{dd($page)}}
@@ -0,0 +1 @@
tu nic neni
+7
View File
@@ -0,0 +1,7 @@
<?php
$config = include_once __DIR__.'/../Base/OnePage/config.php';
$config['handler'] = \Templates\Jednostrankovka\Handler::class;
$config['alias'] = 'jednostrankovka';
return $config;