From: Michael M Slusarz Date: Tue, 25 May 2010 19:42:21 +0000 (-0600) Subject: Allow get() to handle a default form value. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=09066b37cfaae4f2378b5ea3d6c0f0d022f7753f;p=horde.git Allow get() to handle a default form value. --- 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; } /**