PHP code example of aka03 / yii2-comments

1. Go to this page and download the library: Download aka03/yii2-comments 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/ */

    

aka03 / yii2-comments example snippets


<?= \aka03\comments\CommentWidget::widget([
    'page' => $this->context->id,
    'page_id' => $model->id,
]); 

'page' => $this->context->module->id

<?= \aka03\comments\CommentWidget::widget([
    'page' => 'site',
    'page_id' => 'about'
]); 

<?= \aka03\comments\CommentWidget::widget([
    'page' => 'about'
]); 

<?= \aka03\comments\CommentWidget::widget([
    'page' => $this->context->id,
    'page_id' => $model->id,
    'guestCanLeaveComment' => true,
    'showCommentsForGuests' => true,
    'showRelativeTime' => true,
    'avatarField' => 'avatar',
]); 

codecept run



define('MY_APP_STARTED', true);

'bootstrap' => [
    'aka03\comments\modules\testPage\Bootstrap'
],
'modules' => [
    'testPage' => [
        'class' => 'aka03\comments\modules\testPage\Module',
    ],
]

php composer.phar 

php yii migrate --migrationPath=@vendor/aka03/yii2-comments/src/migrations