mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 21:12:14 +00:00
@@ -154,4 +154,16 @@ class Request {
|
|||||||
return $this->loadedRoute;
|
return $this->loadedRoute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isFormatAccepted($format) {
|
||||||
|
return (isset($_SERVER['HTTP_ACCEPT']) && stripos($_SERVER['HTTP_ACCEPT'], $format) > -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAcceptFormats() {
|
||||||
|
if(isset($_SERVER['HTTP_ACCEPT'])) {
|
||||||
|
return explode(',', $_SERVER['HTTP_ACCEPT']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -201,7 +201,7 @@ abstract class RouterEntry {
|
|||||||
*/
|
*/
|
||||||
public function addSettings(array $settings = null) {
|
public function addSettings(array $settings = null) {
|
||||||
if(is_array($settings)) {
|
if(is_array($settings)) {
|
||||||
$this->settings = array_merge($this->settings, $settings);
|
$this->settings = array_merge($settings, $this->settings);
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user