Skip to content

Commit 04acb21

Browse files
author
Igor Chepurnoy
committed
Update README.md
1 parent 88a3a82 commit 04acb21

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff 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")

0 commit comments

Comments
 (0)