Comments module for Yii2.
The preferred way to install this extension is through composer.
try
composer require "ogheo/yii2-comments:*"
or add
"ogheo/yii2-comments": "*"
to the require section of your composer.json
file.
php yii migrate/up --migrationPath=@vendor/ogheo/yii2-comments/src/migrations
'modules' => [
'comments' => [
'class' => 'ogheo\comments\Module',
]
]
All available options can be viewed in Comments module file.
Add one of the following examples to the view file.
Model is not mandatory, comments will be associated to the current url.
use ogheo\comments\widget\Comments;
echo Comments::widget();
To change default settings, you can do as follows:
use ogheo\comments\widget\Comments;
echo Comments::widget([
'model' => $model,
'model_key' => $model_key,
]);
All available options can be viewed in Comments widget file.
Enjoy ;)