Native rules can verify that the user name is duplicated
[' username ', ' unique ', ' targetclass ' = ' \app\models\student ', ' message ' = ' username repeat '],
This is OK, I mean, when users log in to check the table, whether there is a user name, there is no prompt user, user name does not exist, there is such a rule, no, I have to write Ajax
Reply content:
Native rules can verify that the user name is duplicated
[' username ', ' unique ', ' targetclass ' = ' \app\models\student ', ' message ' = ' username repeat '],
This is OK, I mean, when users log in to check the table, whether there is a user name, there is no prompt user, user name does not exist, there is such a rule, no, I have to write Ajax
I he is a genius, rules have exist rule, so it is OK
[[' username '], ' exist ', ' targetclass ' = ' \app\models\student ', ' message ' = ' username not exist '],