B
B
Bogdanmi2019-04-12 11:03:41
Yii
Bogdanmi, 2019-04-12 11:03:41

Validation against linked table yii2?

There is an input form (model-1), a number is entered in one of the fields, you need to check if there is a record with an ID equal to this number in the associated table (model-2). Is there a built-in validator for this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Bragin, 2019-04-12
@Bogdanmi

https://www.yiiframework.com/doc/guide/2.0/en/tuto... - your option with targetClass(targetRelation)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question