* @link http://www.php-tools.net */ /** * Takes a patForms object, asks it if there are any validation * errors and displays them if need be. * * NOTE: this is just a helper method for our examples collection, * so that you may concentrate on the relevant parts of the examples. * It does in no way represent the way it should be done :) * * @access public * @param object &$form The patForms object to use */ function displayErrors( &$form ) { // get the errors from the form object - if there are none, // this returns false so it is easy to check if there are any. $errors = $form->getValidationErrors(); // if there are any errors, display them. if ($errors) { echo '
'.$els[$i]->getAttribute( 'label' ).' | : | '.var2string( $els[$i]->getValue() ).' | '; echo '