diff --git a/init.php b/init.php index 7eef973..f155a4c 100644 --- a/init.php +++ b/init.php @@ -845,7 +845,7 @@ use MVC\Core\Controller; use MVC\Classes\Api; class ApiController extends Controller { - public static function (){ + public static function get(){ return Api::jsonResponse([ 'data' => 'DummyData', ]); @@ -913,15 +913,11 @@ class TestController extends Controller { } PHP; -// --- VIEWS --- -$files['WEBROOT/src/MVC/View/home.php'] = "

Dashboard

Willkommen in deinem neuen MVC-System mit integriertem Header.

"; -$files['WEBROOT/src/MVC/View/test1.php'] = "

Service 1

"; -$files['WEBROOT/src/MVC/View/test2.php'] = "

System Check

"; - // --- API --- -$files['WEBROOT/api/v1/get.php'] = <<<'PHP +$files['WEBROOT/api/v1/get.php'] = <<<'PHP' get()); -catch (\Exception $e) { - Api::jsonResponse(§e->getMessage(), 404); + echo ($api->get()); +} catch (\Exception $e) { + echo ($e->getMessage()); } - PHP; + +// --- VIEWS --- +$files['WEBROOT/src/MVC/View/home.php'] = "

Dashboard

Willkommen in deinem neuen MVC-System mit integriertem Header.

"; +$files['WEBROOT/src/MVC/View/test1.php'] = "

Service 1

"; +$files['WEBROOT/src/MVC/View/test2.php'] = "

System Check

"; + // --- ENTRY POINT --- $files['WEBROOT/index.php'] = <<<'PHP'