From 234ffbecb3d5154e9575891449c082ca178fc889 Mon Sep 17 00:00:00 2001 From: Vlad Jula-Nedelcu Date: Wed, 16 Mar 2016 00:04:04 +0200 Subject: [PATCH] Added an error mesage --- EuVatValidator.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/EuVatValidator.php b/EuVatValidator.php index a170839..f1fb47c 100644 --- a/EuVatValidator.php +++ b/EuVatValidator.php @@ -1,9 +1,10 @@ client->checkVat(['countryCode' => $this->country_code, 'vatNumber' => $model->$attribute]); if (!$rs->valid) { - $this->addError($model, $attribute, $this->message); + $this->addError($model, $attribute, + $this->message ? $this->message : Yii::t('yii', '{attribute} is invalid.')); } else { if ($this->populate_model) { $this->model_name_attribute = $this->cleanUpString($rs->name);