src/ItePHP/Component/Form/FormBuilder.php
public function getErrors(){
		$errors=[];
		foreach($this->fields as $field){
			if(!$field->isValid()){				
				$errors[]=['field'=>$field->getLabel(),'message'=>$field->getError()];
			}
		}

		return $errors;
	}
public function getErrors(){
		$errors=[];
		foreach($this->fields as $field){
			if(!$field->isValid()){				
				$errors[]=['field'=>$field->getLabel(),'message'=>$field->getError()];
			}
		}

		return $errors;
	}
public function getErrors ( ) { $ errors = [ ] ; foreach ( $ this -> fields as $ field ) { if ( ! $ field -> isValid ( ) ) { $ errors [ ] = [ 'field' => $ field -> getLabel ( ) , 'message' => $ field -> getError ( ) ] ; } } return $ errors ; }
Validate fields and get errors

@return array - with errors if success then empty array
Validate fields and get errors