diff --git a/App/Controllers/WelcomeController.php b/App/Controllers/WelcomeController.php index fb68b1a..07a88a8 100644 --- a/App/Controllers/WelcomeController.php +++ b/App/Controllers/WelcomeController.php @@ -27,6 +27,7 @@ public function welcome() public function demo() { - return View::make('welcome')->withComponent($data);; + $data = []; + return View::make('welcome')->withComponent($data); } } diff --git a/App/Routes.php b/App/Routes.php index 744cde4..6fffbd9 100644 --- a/App/Routes.php +++ b/App/Routes.php @@ -15,3 +15,4 @@ use Silver\Core\Route; Route::get('/', 'Welcome@welcome', 'home', 'public'); +Route::get('/demo', 'Welcome@demo', 'home', 'public'); diff --git a/App/Templates/Controller.ghost.tpl b/App/Templates/Controller.ghost.tpl index 3e31e2f..fa1c130 100644 --- a/App/Templates/Controller.ghost.tpl +++ b/App/Templates/Controller.ghost.tpl @@ -3,6 +3,7 @@ namespace App\Controllers; use Silver\Core\Controller; +use Silver\Http\View; /** * {{{$name}}} controller @@ -11,21 +12,22 @@ class {{{ucfirst($name)}}}Controller extends Controller { public function get() { - return "Welcome in {{$name}} controller. This file is on App/Controllers/"; + echo "Welcome in {{$name}} controller. This file is on App/Controllers/"; + //return View::make(''); } public function post() { - echo 'Methode: post'; + echo 'Method: post'; } public function put() { - echo 'Methode: put'; + echo 'Method: put'; } public function delete() { - echo 'Methode: delete'; + echo 'Method: delete'; } } diff --git a/App/Templates/View.ghost.tpl b/App/Templates/View.ghost.tpl index 5390165..c5cc0f0 100644 --- a/App/Templates/View.ghost.tpl +++ b/App/Templates/View.ghost.tpl @@ -1,7 +1,5 @@ +{{ extends('layouts.master') }} - - - - - - Welcome in {{{$name}}}. \ No newline at end of file +#set[content] + Welcome in {{{$name}}}. +#end diff --git a/App/Views/components/demo.ghost.php b/App/Views/components/demo.ghost.tpl similarity index 100% rename from App/Views/components/demo.ghost.php rename to App/Views/components/demo.ghost.tpl diff --git a/App/Views/errors/.gitkeep b/App/Views/errors/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/App/Views/layouts/master.ghost.php b/App/Views/layouts/master.ghost.tpl similarity index 99% rename from App/Views/layouts/master.ghost.php rename to App/Views/layouts/master.ghost.tpl index ac44166..149131d 100644 --- a/App/Views/layouts/master.ghost.php +++ b/App/Views/layouts/master.ghost.tpl @@ -13,12 +13,9 @@
- -#block(content) - welcome +#block(content) {{ js('app') }} -