summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-09 17:44:33 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-09 17:44:33 -0400
commit3b492685185e1bdce9fb9f1c6f13cd2161883734 (patch)
treed508c77a8b8e9ec592b96e099b85fdb571dd5eed /lib
parent5adb386774887b4d581b7aad3a9000eab703aa1a (diff)
defaults for argument functions
darcs-hash:20080709214433-84dde-4cb9de9ca054c54ebeb028bc3382ae07f4b7f5e1.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/action.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/action.php b/lib/action.php
index 81b228312..45d696442 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -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;
}