[[+content_image]]
S
S
shitprog2019-01-23 18:59:49
Yii
shitprog, 2019-01-23 18:59:49

How to get the id of an existing post?

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

How to get the id of an existing post to show a link to it?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
M
Maxim Timofeev, 2019-01-23
@shitprog

https://www.yiiframework.com/doc/api/2.0/yii-valid...
respectively, if there was one attribute for validation, then it would probably be like this
And so, apparently, you will have to do without the built-in validator and write your own custom one:
https://www.yiiframework.com/doc/guide/2.0/en/inpu...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question