[Solar-svn] Revision 3092

pmjones at solarphp.com pmjones at solarphp.com
Thu Apr 10 18:13:05 CDT 2008


Solar_Form: [ADD] Method setType() to set the type of a single element (if it exists).


Modified: trunk/Solar/Form.php
===================================================================
--- trunk/Solar/Form.php	2008-04-10 23:11:13 UTC (rev 3091)
+++ trunk/Solar/Form.php	2008-04-10 23:13:05 UTC (rev 3092)
@@ -364,6 +364,27 @@
     
     /**
      * 
+     * Sets the type of one element.
+     * 
+     * @param string $name The element name.
+     * 
+     * @param string $type The element type ('text', 'select', etc).
+     * 
+     * @param string $array Rename the element as a key in this array.
+     * 
+     * @return void
+     * 
+     */
+    public function setType($name, $type, $array = null)
+    {
+        $name = $this->_prepareName($name, $array);
+        if (! empty($this->elements[$name])) {
+            $this->elements[$name]['type'] = $type;
+        }
+    }
+    
+    /**
+     * 
      * Reorders the existing elements.
      * 
      * @param array $list The order in which elements should be placed; each




More information about the Solar-svn mailing list