isaurssaurav / yii2-comment
light Yii2 comment widget
Installs: 35
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 1
Type:yii2-extension
Requires
- php: >=5.4.0
- yiisoft/yii2: >=2.0.10
This package is not auto-updated.
Last update: 2025-06-07 23:27:40 UTC
README
The preferred way to install this extension is through composer.
Either run
composer require isaurssaurav/yii2-comment
or add
"isaurssaurav/yii2-comment": "*"
to the require section of your composer.json. Font Awesome is required*
Configuration
Database Migrations
Before using Comments Widget, we'll also need to prepare the database.
php yii migrate --migrationPath=@vendor/isaurssaurav/yii2-comment/migration
Module setup To access the module, you need to add the following code to your application configuration:
'modules' => [ 'comment' => [ 'class' => 'isaurssaurav\yii\comment\Module', ], ]
Usage
Basic example:
use isaurssaurav\yii\comment\widgets\CommentWidget;
//echo where you want to show comment
echo CommentWidget::widget();
Properties
1.limit Default value is 2 No of comment you want to show at first.This number also controls number of comment shown after LOAD MORE is clicked 2.sort ASC or DESC 3.recognize_schema Defaultly it catches current url, but You can changed it to idk page_id or something
use isaurssaurav\yii\comment\widgets\CommentWidget;
//echo where you want to show comment
echo CommentWidget::widget([
limit => 10,
sort => DESC,
]);