diff options
| author | Syndamia <kamen@syndamia.com> | 2025-01-18 20:41:48 +0200 |
|---|---|---|
| committer | Kamen Mladenov <kamen@syndamia.com> | 2025-01-19 07:46:17 +0200 |
| commit | 6aaa4ff113c9a5ca9c022d8fa39a43ffca288948 (patch) | |
| tree | d36f9b6147da8b20a502a12d83151c3fecee6c75 /controllers | |
| parent | 91f9b1c6e8db741f2b6f55b84dab39b34c213d00 (diff) | |
| download | nowayforward_human-6aaa4ff113c9a5ca9c022d8fa39a43ffca288948.tar nowayforward_human-6aaa4ff113c9a5ca9c022d8fa39a43ffca288948.tar.gz nowayforward_human-6aaa4ff113c9a5ca9c022d8fa39a43ffca288948.zip | |
feat(controllers): Add a test controller
Diffstat (limited to 'controllers')
| -rw-r--r-- | controllers/meta.php | 12 | ||||
| -rw-r--r-- | controllers/test.php | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/controllers/meta.php b/controllers/meta.php new file mode 100644 index 0000000..ea26c30 --- /dev/null +++ b/controllers/meta.php @@ -0,0 +1,12 @@ +<?php + +foreach (glob("../models/*.php") as $filename) { + include $filename; +} + +match ($_SERVER['REQUEST_METHOD']) { + 'POST' => on_post(), + 'GET' => on_get(), + 'PUT' => on_put(), + 'DELETE' => on_delete(), +}; diff --git a/controllers/test.php b/controllers/test.php new file mode 100644 index 0000000..1b3b2c4 --- /dev/null +++ b/controllers/test.php @@ -0,0 +1,5 @@ +<?php + +function on_post() { + Database\User::create($_POST["Username"], "", "User"); +} |
