Образован хелпер Error, в который вынесены все коды ошибок.

Подкорректирован errorDict на фронте
This commit is contained in:
ErickSkrauch
2016-06-16 23:32:23 +03:00
parent 4614cf8fe7
commit 8906370bb9
22 changed files with 146 additions and 61 deletions

View File

@@ -2,6 +2,7 @@
namespace api\models\profile;
use api\models\base\PasswordProtectedForm;
use common\helpers\Error;
use common\helpers\Amqp;
use common\models\amqp\UsernameChanged;
use common\models\UsernameHistory;
@@ -16,8 +17,8 @@ class ChangeUsernameForm extends PasswordProtectedForm {
public function rules() {
return ArrayHelper::merge(parent::rules(), [
[['username'], 'required', 'message' => 'error.{attribute}_required'],
[['username'], 'validateUsername'],
['username', 'required', 'message' => Error::USERNAME_REQUIRED],
['username', 'validateUsername'],
]);
}