nur-sery/nur_src/R.php

23 lines
574 B
PHP
Raw Normal View History

2023-12-03 22:10:18 +04:00
<?php
namespace nur;
use nur\b\values\Mparams;
/**
* Class R: gestion des paramètres $_REQUEST (GET + POST + COOKIES)
*/
class R extends Mparams {
/** tester si le paramètre $name existe */
static final function has($name): bool {
if ($name === null || $name === false) return false;
return array_key_exists($name, $_REQUEST);
}
/** obtenir le paramètre $name */
static final function get($name, $default=null, bool $trim=false) {
$value = A::get($_REQUEST, $name, $default);
if ($trim) $value = str::trim($value);
return $value;
}
}