E
E
elsamelaski2019-02-23 16:52:54
Yii
elsamelaski, 2019-02-23 16:52:54

How to make rules to validate a record in a database in YII2?

Good day! I want to make an invite code, without which you can not register. I know that it is possible to link the rules to the database (as is done, for example, with checking for the uniqueness of the e-mail address), and accordingly, if there is no code in the database, throw an error, if there is, finish the registration and delete the code. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
padlyuck, 2019-02-23
@elsamelaski

and why ExistValidator did not please you? and it’s not difficult to see how standard validators are implemented and write your own

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question