mail func added, post route added, more css
This commit is contained in:
@ -2,12 +2,15 @@
|
||||
class Router {
|
||||
public $returned = false;
|
||||
|
||||
function route($url, $filename) {
|
||||
if($_SERVER['REQUEST_METHOD'] == 'GET') {
|
||||
if ($_SERVER['REQUEST_URI'] == $url) {
|
||||
require_once("./pages/$filename/$filename.php");
|
||||
$this->returned = true;
|
||||
return;
|
||||
function route($method, $url, $filename) {
|
||||
$methods = ['GET', 'POST'];
|
||||
if(in_array($method, $methods)) {
|
||||
if($_SERVER['REQUEST_METHOD'] == $method) {
|
||||
if ($_SERVER['REQUEST_URI'] == $url) {
|
||||
require_once("./pages/$filename/$filename.php");
|
||||
$this->returned = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user