File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -61,18 +61,31 @@ Usage
6161
6262``` php
6363<?php echo \yii2mod\comments\widgets\Comment::widget([
64- 'model' => $model
64+ 'model' => $model,
65+ 'relatedTo' => 'User ' . \Yii::$app->user->identity->username . ' commented on the page ' . \yii\helpers\Url::current() // for example
6566]); ?>
6667```
6768
68- ``` 2.3 Also you can use own template for render comments. ```
69+ ``` 2.3 You can use your own template for render comments. ```
6970
7071 ``` php
7172<?php echo \yii2mod\comments\widgets\Comment::widget([
7273 'model' => $model,
7374 'commentView' => '@app/views/site/comments/index' //path to your template
7475]); ?>
7576 ```
77+ ``` 2.4 Use the following code for multiple widgets on the same page: ```
78+ ``` php
79+ echo \yii2mod\comments\widgets\Comment::widget([
80+ 'model' => $model,
81+ ]);
82+
83+ echo \yii2mod\comments\widgets\Comment::widget([
84+ 'model' => $model2,
85+ 'formId' => 'comment-form2'
86+ ]);
87+ ```
88+
7689#### Example comments
7790-----
7891![ Alt text] ( http://res.cloudinary.com/zfort/image/upload/v1438350103/comments_fooguz.png " Example comments ")
You can’t perform that action at this time.
0 commit comments