zorinpavel / yii2-star-rating
A Yii2 widget for the simple star-rating plugin with captions and colors
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ^2.0.0
This package is auto-updated.
Last update: 2025-06-22 15:02:31 UTC
README
A Yii2 widget for the simple star-rating plugin with fractional rating support
How does it work
composer require zorinpavel/yii2-star-rating
<?php use zorinpavel\StarRating\StarRatingWidget; echo StarRatingWidget::widget([ 'id' => 'feedback-id', // name for the input field 'name' => 'feedback', 'value' => false, // how many stars do you want 'stars' => 5, // switch off user interaction 'disabled' => false, // input field will be with required attribute 'required' => true, // you can specify captions for each star 'starCaptions' => [ 0 => 'nothing', 1 => 'bad', 2 => 'sad', 3 => 'ok', 4 => 'good', 5 => 'very good', ], ]);