Skip to content

Latest commit

 

History

History
30 lines (28 loc) · 569 Bytes

starRating.md

File metadata and controls

30 lines (28 loc) · 569 Bytes

name -> clientOptions.scoreName

<?php
$this->widget('CStarRating', array(
    'name' => 'some_name',
    'id' => 'id_rating',
    'readOnly' => !$isStaffLogged,
    'resetText' => 'Zero rating',
    'value' => $model->rating
));
?>

To

<?php
echo \yii2mod\rating\StarRating::widget([
    'name' => 'some_name',
    'id' => 'id_rating',
    'value' => $model->rating,
    'clientOptions' => [
        'scoreName' => 'some_name',
        'readOnly' => !$isStaffLogged,
        'cancel' => true,
        'cancelHint' => 'Zero rating',
    ],
 ]);
?>