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
61
61
62
62
``` php
63
63
<?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
65
66
]); ?>
66
67
```
67
68
68
- ``` 2.3 Also you can use own template for render comments. ```
69
+ ``` 2.3 You can use your own template for render comments. ```
69
70
70
71
``` php
71
72
<?php echo \yii2mod\comments\widgets\Comment::widget([
72
73
'model' => $model,
73
74
'commentView' => '@app/views/site/comments/index' //path to your template
74
75
]); ?>
75
76
```
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
+
76
89
#### Example comments
77
90
-----
78
91
![ 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