]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
defaults for argument functions
authorEvan Prodromou <evan@prodromou.name>
Wed, 9 Jul 2008 21:44:33 +0000 (17:44 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 9 Jul 2008 21:44:33 +0000 (17:44 -0400)
darcs-hash:20080709214433-84dde-4cb9de9ca054c54ebeb028bc3382ae07f4b7f5e1.gz

lib/action.php

index 81b2283124575c15cbb61ceee0c54d1a031e56ff..45d696442874f8602e55a5f654c69e57212916cc 100644 (file)
@@ -26,16 +26,16 @@ class Action { // lawsuit
        function Action() {
        }
 
-       function arg($key) {
+       function arg($key, $def=NULL) {
                if (array_key_exists($key, $this->args)) {
                        return $this->args[$key];
                } else {
-                       return NULL;
+                       return $def;
                }
        }
 
-       function trimmed($key) {
-               $arg = $this->arg($key);
+       function trimmed($key, $def=NULL) {
+               $arg = $this->arg($key, $def);
                return (is_string($arg)) ? trim($arg) : $arg;
        }