[[+content_image]]
S
S
shitprog2019-01-23 17:55:40
Yii
shitprog, 2019-01-23 17:55:40

How to check another rule if one returned false?

There is a rule:

public function rules()
    {
        return [
     [['user_id', 'word'], 'unique', 'targetAttribute' => ['user_id', 'word'], 'message' => 'У вас уже есть такая запись'],
        ];
    }

How to make a check according to such a rule if this does not pass the check?
[['user_id', 'word','field'], 'unique', 'targetAttribute' => ['user_id', 'word','field'], 'message' => 'У вас уже есть такая запись'],

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
M
morricone85, 2019-01-23
@morricone85

Conditional Validations

A
Andrew, 2019-01-24
@R0dger

Is writing your own validator not an option?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question