PHP code example of fgh151 / yii2-review

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

    

fgh151 / yii2-review example snippets


    'modules' => [
        'review' => [
            'class' => 'fgh151\review\Module',
        ],
        //...
    ]


use fgh151\review\widgets\ReviewList;
use fgh151\review\widgets\ReviewForm;

<?=ReviewForm::widget([
    'modelId' => $model->id,
    'entity' => $model::className(),
    'viewFolder' => '@app/widgets/yii2-review/views'
]);

php composer 

php yii migrate --migrationPath=vendor/fgh151/yii2-review/migrations
config/web.php
[backend|frontend|common]/config/main.php

>
        'modules'    => [
             'review' => [
                 'class' => 'fgh151\review\Module',
                 'as access' => [
                     'class' => 'yii\filters\AccessControl',
                     'rules' => [
                         [
                             'allow' => true,
                             'roles' => ['admin'],
                         ]
                     ]
                 ]
             ]
            ...
            ...
        ],