aboutsummaryrefslogtreecommitdiff
path: root/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'controllers')
-rw-r--r--controllers/meta.php12
-rw-r--r--controllers/test.php5
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");
+}