ferrumfist / yii2-star-rating
Star rating widget based on jQuery Raty https://github.com/wbotelhos/raty
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 3
Type:yii2-extension
Requires
- bower-asset/ratyfa: *
- simialbi/yii2-schema-org: *
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-10-27 19:50:17 UTC
README
Star Rating Widget for Yii 2
Star Rating widget based on Raty extension https://github.com/wbotelhos/raty
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yii2mod/yii2-star-rating "*"
or add
"yii2mod/yii2-star-rating": "*"
to the require section of your composer.json.
Usage
Once the extension is installed, simply add widget to your page as follows:
- Usage with ActiveForm and model
echo $form->field($model, 'attribute')->widget(\yii2mod\rating\StarRating::class, [ 'options' => [ // Your additional tag options ], 'clientOptions' => [ // Your client options ], ]);
- Usage without a model
echo \yii2mod\rating\StarRating::widget([ 'name' => 'input_name', 'value' => 5, 'clientOptions' => [ // Your client options ], ]);
Star Rating Options
You can find them on the options page