Add support for post method

This commit is contained in:
Kazhnuz 2025-03-29 10:25:21 +01:00
parent 33000bd970
commit ac4c2646c8

View file

@ -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);
}