[[+content_image]]
S
S
shitprog2019-01-23 17:24:57
Yii
shitprog, 2019-01-23 17:24:57

How to insert link in message ActiveRecord?

There is an ActiveRecord model rule:

public function rules()
    {
        return [
            [['user_id', 'word'], 'unique', 'targetAttribute' => ['user_id', 'word'], 'message' => 'Уже есть'],
        ];
    }

How to insert a link to an existing entry in the message, they say this is the entry, edit it?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
E
Evgeny Bukharev, 2019-01-23
@evgenybuckharev

[['user_id', 'word'], 'unique', 'targetAttribute' => ['user_id', 'word'], 'message' =>Html::a('Уже есть',['/test/test'])],

Only when displaying errors, it is necessary to disable message enconding

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question