projects
/
quix0rs-gnu-social.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5adb386
)
defaults for argument functions
author
Evan Prodromou
<evan@prodromou.name>
Wed, 9 Jul 2008 21:44:33 +0000
(17:44 -0400)
committer
Evan Prodromou
<evan@prodromou.name>
Wed, 9 Jul 2008 21:44:33 +0000
(17:44 -0400)
darcs-hash:
20080709214433
-84dde-
4cb9de9ca054c54ebeb028bc3382ae07f4b7f5e1
.gz
lib/action.php
patch
|
blob
|
history
diff --git
a/lib/action.php
b/lib/action.php
index 81b2283124575c15cbb61ceee0c54d1a031e56ff..45d696442874f8602e55a5f654c69e57212916cc 100644
(file)
--- 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;
}