diff options
Diffstat (limited to 'lib/Minz/Request.php')
| -rw-r--r-- | lib/Minz/Request.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index a43509ded..e21697e42 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -39,6 +39,19 @@ class Minz_Request { return $default; } } + public static function paramTernary($key) { + if (isset(self::$params[$key])) { + $p = self::$params[$key]; + $tp = trim($p); + if ($p === null || $tp === '' || $tp === 'null') { + return null; + } elseif ($p == false || $tp == '0' || $tp === 'false' || $tp === 'no') { + return false; + } + return true; + } + return null; + } public static function defaultControllerName() { return self::$default_controller_name; } |
