From 09066b37cfaae4f2378b5ea3d6c0f0d022f7753f Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 25 May 2010 13:42:21 -0600 Subject: [PATCH] Allow get() to handle a default form value. --- framework/Util/lib/Horde/Variables.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/framework/Util/lib/Horde/Variables.php b/framework/Util/lib/Horde/Variables.php index 694d3cf33..97b739f20 100644 --- a/framework/Util/lib/Horde/Variables.php +++ b/framework/Util/lib/Horde/Variables.php @@ -126,12 +126,15 @@ class Horde_Variables * Returns the value of a given form variable. * * @param string $varname The form variable name. + * @param string $default The default form variable value. * * @return mixed The form variable, or null if it doesn't exist. */ - public function get($varname) + public function get($varname, $default = null) { - return $this->__get($varname); + return $this->_getExists($this->_vars, $varname, $value) + ? $value + : $default; } /** -- 2.11.0