diff --git a/kernel/router.php b/kernel/router.php index 19f13e3..e3380af 100644 --- a/kernel/router.php +++ b/kernel/router.php @@ -33,8 +33,13 @@ class Router { $controllerFile = $this->getControllerPath(); require_once $controllerFile; - if (is_callable($this->func)) { - call_user_func($this->func); + $func = $this->func; + if (isset($_POST["submit"])) { + $func = $func."_post"; + } + + if (is_callable($func)) { + call_user_func($func); } else { $renderer->error(404); }