[Solar-svn] Revision 3020

pmjones at solarphp.com pmjones at solarphp.com
Thu Mar 20 07:40:06 CDT 2008


Solar_View_Helper_Form

* [CHG] Method addProcess() now sets the element ID to "process-name" when the ID is empty.

* [FIX] Now catches the right exception when an element helper is not found, allowing it to correctly fall back to the "text" element.


Modified: trunk/Solar/View/Helper/Form.php
===================================================================
--- trunk/Solar/View/Helper/Form.php	2008-03-20 12:37:52 UTC (rev 3019)
+++ trunk/Solar/View/Helper/Form.php	2008-03-20 12:40:06 UTC (rev 3020)
@@ -403,6 +403,11 @@
         
         $info = array_merge((array) $info, $base);
         
+        if (empty($info['attribs']['id'])) {
+            $id = str_replace('_', '-', strtolower($key));
+            $info['attribs']['id'] = $id;
+        }
+        
         return $this->addElement($info);
     }
     
@@ -649,14 +654,10 @@
                 try {
                     // look for the requested element helper
                     $helper = $this->_view->getHelper($method);
-                } catch (Solar_View_Exception $e) {
+                } catch (Solar_Class_Stack_Exception_ClassNotFound $e) {
                     // use 'text' helper as a fallback
-                    if ($e->getCode() == 'ERR_HELPER_FILE_NOT_FOUND' ||
-                        $e->getCode() == 'ERR_HELPER_CLASS_NOT_FOUND') {
-                        // use 'text' helper
-                        $method = 'formText';
-                        $helper = $this->_view->getHelper($method);
-                    }
+                    $method = 'formText';
+                    $helper = $this->_view->getHelper($method);
                 }
                 
                 // SPECIAL CASE:




More information about the Solar-svn mailing list