From 3b492685185e1bdce9fb9f1c6f13cd2161883734 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 9 Jul 2008 17:44:33 -0400 Subject: [PATCH] defaults for argument functions darcs-hash:20080709214433-84dde-4cb9de9ca054c54ebeb028bc3382ae07f4b7f5e1.gz --- lib/action.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/action.php b/lib/action.php index 81b2283124..45d6964428 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; } -- 2.39.5