PHP code example of elephantsgroup / eg-star-rating

1. Go to this page and download the library: Download elephantsgroup/eg-star-rating 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/ */

    

elephantsgroup / eg-star-rating example snippets

'as access' => [
    'class' => 'mdm\admin\components\AccessControl',
    'allowActions' => [
        ...
        'star-rating/ajax/*',
        ...
    ]
]
'modules' => [
    ...
    'star-rating' => [
        'as frontend' => 'elephantsGroup\starRating\filters\FrontendFilter',
    ],
    ...
]
'modules' => [
    ...
    'star-rating' => [
        'as backend' => 'elephantsGroup\starRating\filters\BackendFilter',
    ],
    ...
]
<?= Rate::widget() 
<?= Rate::widget(['item' => $model->id]) 
<?= Rate::widget([
    'service' => 1,
    'item' => $model->id,
    'color' => 'yellow',
    'view_file' => Yii::getAlias('@frontend') . '/views/star-rating/widget.php'
])