PHP code example of isaurssaurav / yii2-comment

1. Go to this page and download the library: Download isaurssaurav/yii2-comment library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

isaurssaurav / yii2-comment example snippets


php yii migrate --migrationPath=@vendor/isaurssaurav/yii2-comment/migration

'modules' => [
    'comment' => [
        'class' => 'isaurssaurav\yii\comment\Module',
    ],
]

use isaurssaurav\yii\comment\widgets\CommentWidget;

//echo where you want to show comment
 echo CommentWidget::widget();


use isaurssaurav\yii\comment\widgets\CommentWidget;

//echo where you want to show comment
 echo CommentWidget::widget([
	limit => 10,
	sort => DESC,
]);