Last active
August 29, 2015 14:14
-
-
Save silenzium/87313f71a580510c48fb to your computer and use it in GitHub Desktop.
Revisions
-
silenzium revised this gist
Feb 6, 2015 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,17 +2,18 @@ use Zend\Form\FieldsetInterface; /** * Remove all errors in a form recursively * pass a form or a fieldset as parameter * * @param FieldsetInterface $form * @return void */ public function clearFormErrors(FieldsetInterface $form) { $arr = array(); foreach($form->getElements() as $element) { $element->setMessages($arr); } foreach($form->getFieldsets() as $fieldset) { $this->clearFormErrors($fieldset); } } -
silenzium created this gist
Feb 6, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ use Zend\Form\FieldsetInterface; /** * Remove all errors in a form recursively * * @param FieldsetInterface $fieldset * @return void */ public function clearFormErrors(FieldsetInterface $fieldset) { $arr = array(); foreach($fieldset->getElements() as $element) { $element->setMessages($arr); } foreach($fieldset->getFieldsets() as $fieldset) { $this->clearFormErrors($fieldset); } }