defaults for argument functions
darcs-hash:20080709214433-84dde-4cb9de9ca054c54ebeb028bc3382ae07f4b7f5e1.gz
This commit is contained in:
parent
5adb386774
commit
3b49268518
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user