diff --git a/ValidatorBundle/Validator.php b/ValidatorBundle/Validator.php index eb3ab03..71c01b1 100644 --- a/ValidatorBundle/Validator.php +++ b/ValidatorBundle/Validator.php @@ -87,13 +87,13 @@ class Validator foreach ($this->errors as $field => $field_errors) { $errors[$field] = [ - 'error' => "validator.".$field_errors[0].(!is_null($this->context) ? ':'.$this->context : '') + 'error' => "validator.".$field_errors[0].':'.$field.(!is_null($this->context) ? ':'.$this->context : '') ]; } $data = array_merge([ 'message' => 'Please check your input', - 'error' => 'validator.form-error', + 'error' => "validator.form-error".(!is_null($this->context) ? ':'.$this->context : ''), 'errors' => $errors ], $data);