M
M
Messi2017-08-14 16:56:18
Yii
Messi, 2017-08-14 16:56:18

Many form comments on one page?

https://github.com/yeesoft/yii2-comments
Connected this module on the news page.
This page displays news via foreach, you need to connect this module under each news.
I connect in this way:
$item['id] = unique news entry.

echo Comments::widget([
                            'model' => $item['id]'
                    ]);

Under each news, a block for entering comments is displayed, but when saving, the comment is always saved only for the news with id = 1.
Why is that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-08-14
@webinar

echo Comments::widget
- this is not a module connection, but a widget output
apparently because you $item['id']always have one. Or a curve widget. Show the code (the whole cycle) so that we can talk about something

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question