[Solar-svn] Revision 3034

pmjones at solarphp.com pmjones at solarphp.com
Fri Mar 21 14:11:31 CDT 2008


Solar_Form: [ADD] Method getValue() to get a single element value.


Modified: trunk/Solar/Form.php
===================================================================
--- trunk/Solar/Form.php	2008-03-21 17:02:27 UTC (rev 3033)
+++ trunk/Solar/Form.php	2008-03-21 19:11:31 UTC (rev 3034)
@@ -656,6 +656,21 @@
         }
     }
     
+    /**
+     * 
+     * Returns one form element value.
+     * 
+     * @param string $key The element key, including the array name (if any).
+     * 
+     * @return mixed The element value.
+     * 
+     */
+    public function getValue($key)
+    {
+        if (array_key_exists($key, $this->elements)) {
+            return $this->elements[$key]['value'];
+        }
+    }
     
     // -----------------------------------------------------------------
     // 




More information about the Solar-svn mailing list