mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Образован хелпер Error, в который вынесены все коды ошибок.
Подкорректирован errorDict на фронте
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
namespace common\validators;
|
||||
|
||||
use common\helpers\Error as E;
|
||||
use Yii;
|
||||
use yii\validators\Validator;
|
||||
|
||||
class LanguageValidator extends Validator {
|
||||
|
||||
public $message = 'error.unsupported_language';
|
||||
public $message = E::UNSUPPORTED_LANGUAGE;
|
||||
|
||||
protected function validateValue($value) {
|
||||
if (empty($value)) {
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace common\validators;
|
||||
|
||||
use common\helpers\Error as E;
|
||||
use yii\validators\StringValidator;
|
||||
|
||||
/**
|
||||
@@ -10,6 +11,6 @@ class PasswordValidate extends StringValidator {
|
||||
|
||||
public $min = 8;
|
||||
|
||||
public $tooShort = 'error.password_too_short';
|
||||
public $tooShort = E::PASSWORD_TOO_SHORT;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user