w3lifer / yii2-disqus
Installs: 54
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ^2
This package is auto-updated.
Last update: 2024-12-26 18:29:08 UTC
README
Installation
composer require w3lifer/yii2-disqus
Usage
Note, that the number of comments and settings related to comments (https://disqus.com/admin/settings/community) are updated approximately every 20 minutes.
/** * @var $this \yii\web\View */ use w3lifer\yii2\Disqus; // Widget echo Disqus::widget([ 'shortName' => '<short name>', // Required 'pageUrl' => '<page url>', // Optional 'pageIdentifier' => '<page identifier>', // Optional 'language' => '<language>', // Optional; default `Yii::$app->language` 'callbacks' => [ // Optional; sinse 1.2.0 'onReady' => 'function () { alert("onReady"); }', // String 'onNewComment' => [ // Array 'function () { alert("onNewComment 1"); }', 'function () { alert("onNewComment 2"); }', ], ], ]); // Number of comments (since 1.1.0) Disqus::widget([ 'shortName' => '<short name>', // Required 'onlyCountComments' => true, ]);