From b1468d3bcd07d366b09c93b7fced40ce30adabca Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Sun, 17 Nov 2013 20:54:55 +0000 Subject: added method to get all error messages --- core/QuickForm2.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/QuickForm2.php') diff --git a/core/QuickForm2.php b/core/QuickForm2.php index bbdc39e4c5..40d7f1246c 100644 --- a/core/QuickForm2.php +++ b/core/QuickForm2.php @@ -110,6 +110,17 @@ abstract class QuickForm2 extends HTML_QuickForm2 return isset($value[$elementName]) ? $value[$elementName] : null; } + public function getErrorMessages() + { + $messages = array(); + + foreach ($this as $element) { + $messages[] = $element->getError(); + } + + return array_filter($messages); + } + /** * Returns the rendered form as an array. * -- cgit v1.2.3