✨ Add support for post method
This commit is contained in:
parent
33000bd970
commit
ac4c2646c8
1 changed files with 7 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue