mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 16:02:16 +00:00
@@ -10,7 +10,7 @@ class Request {
|
|||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->host = $_SERVER['HTTP_HOST'];
|
$this->host = $_SERVER['HTTP_HOST'];
|
||||||
$this->uri = rtrim($_SERVER['REQUEST_URI'], '/') . '/';
|
$this->uri = $_SERVER['REQUEST_URI'];
|
||||||
$this->method = (isset($_POST['_method'])) ? strtolower($_POST['_method']) : strtolower($_SERVER['REQUEST_METHOD']);
|
$this->method = (isset($_POST['_method'])) ? strtolower($_POST['_method']) : strtolower($_SERVER['REQUEST_METHOD']);
|
||||||
$this->headers = getallheaders();
|
$this->headers = getallheaders();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class RouterRoute extends RouterEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function parseParameters($url, $multiple = false, $regex = self::PARAMETERS_REGEX_MATCH) {
|
protected function parseParameters($url, $multiple = false, $regex = self::PARAMETERS_REGEX_MATCH) {
|
||||||
|
$url = rtrim($url, '/');
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
|
|
||||||
if($multiple) {
|
if($multiple) {
|
||||||
|
|||||||
Reference in New Issue
Block a user