From 2b4f9d968c29d9162907dbbf156b12380f3aeb21 Mon Sep 17 00:00:00 2001 From: Maxime Renou Date: Fri, 1 Mar 2019 16:13:49 +0100 Subject: [PATCH] JSON --- ValidatorBundle/Validator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);