vova07 / yii2-start

Yii2-Start application
Other
273 stars 115 forks source link

Spanish accents or latin into name and surname not work #109

Closed carlos-andres closed 9 years ago

carlos-andres commented 9 years ago

Good Day.. i discover this amazing project and i like so much, but when i try to add or update some user i cannot add accent "tilde" or special character into name or surname

many thanks for your support!.

accent

vova07 commented 9 years ago

Hello! The problem is in the model rules. To solve it, you need to extend Profile model from yii2-start-users-module and cover the rules method with your own. After you need to "inject" your own model by DI or ClassMap to users-module. Hope this info will be helpful for your.

carlos-andres commented 9 years ago

Greetings Vasile C,

Oh, that´s a lot of information for me, and this is excelent, but i think is a clever way to replace the regex pattern in rules, and work with native module that you´re build, because it´s amazing!

what i suggest if is possible:

In Profile model from yii2-start-users-module on rules section

replace all patterns for this and includes regular a-z characters along with accented ones

"~^[a-zÀ-ÿ][\\'a-zÀ-ÿ \\-]*$~i"

Many thanks of course for the new information and your support.

calo.

vova07 commented 9 years ago

Fixed! https://github.com/vova07/yii2-start-users-module/commit/d1ec9e1d1f847d6b8db9582cd1e5e588aca9f773 I aded 3 new attributes to Module. Now you ca set your own pattern for username, name and surname.