Update 'src/RR/Request.php'
This commit is contained in:
+19
-3
@@ -28,11 +28,27 @@ class Request{
|
||||
}
|
||||
|
||||
public static function requiredParamArray($parname, $type, $default = '', $options = Array() ){
|
||||
|
||||
// POST has precedence.
|
||||
if (isset($_POST[$parname])) {
|
||||
$param = $_POST[$parname];
|
||||
} else if (isset($_GET[$parname])) {
|
||||
$param = $_GET[$parname];
|
||||
} else {
|
||||
return $default;
|
||||
}
|
||||
return $param;
|
||||
}
|
||||
|
||||
public static function optionalParam(){
|
||||
|
||||
public static function optionalParam($parname, $type, $default = '', $options = Array()){
|
||||
// POST has precedence.
|
||||
if (isset($_POST[$parname])) {
|
||||
$param = $_POST[$parname];
|
||||
} else if (isset($_GET[$parname])) {
|
||||
$param = $_GET[$parname];
|
||||
} else {
|
||||
return $default;
|
||||
}
|
||||
return $param;
|
||||
}
|
||||
|
||||
public static function optionalParamArray(){
|
||||
|
||||
Reference in New Issue
Block a user