mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 16:52:13 +00:00
[FEATURE] Added getInput method to return request items.
This commit is contained in:
@@ -93,4 +93,14 @@ class Request {
|
|||||||
return (isset($this->headers[$name])) ? $this->headers[$name] : null;
|
return (isset($this->headers[$name])) ? $this->headers[$name] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get request input or default value
|
||||||
|
* @param string $name
|
||||||
|
* @param string $defaultValue
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getInput($name, $defaultValue) {
|
||||||
|
return (isset($_REQUEST[$name]) ? $_REQUEST[$name] : $defaultValue);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user