Download the PHP package kl83/yii2-rating-widget without Composer
On this page you can find all versions of the php package kl83/yii2-rating-widget. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package yii2-rating-widget
Yii2 rating widget
Allows you to set an stars-rating for something or show it.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require kl83/yii2-rating-widget ^2.0
or add
"kl83/yii2-rating-widget": "^2.0"
to the require section of your composer.json file.
Usage
FontAwesome asset is used to display stars. Version 4.7 is in use. If you do not have it in your project, \kl83\widgets\RatingWidgetFaAsset asset must be registered.
\kl83\widgets\RatingWidgetFaAsset::register(\Yii::$app->view);
Input widget
$form->field($model, 'rating')->widget('kl83\widgets\RatingInput', [
'containerOptions' => ['class' => 'some-class'], // HTML attributes
'maxRating' => 10, // stars count, default - 5
]);
// Sets 5 stars rating
jQuery('.widget').ratingInput('set', 5);
Display widget
\kl83\widgets\RatingWidget::widget([
'maxRating' => 10, // stars count, default - 5
'options' => ['class' => 'some-class'], // HTML attributes
'value' => 4.5, // highlighted stars count
]);
// Initialize widget
jQuery('.widget').ratingWidget();
// Sets 5 stars rating
jQuery('.widget').ratingWidget('set', 5);
License
MIT License
All versions of yii2-rating-widget with dependencies
PHP Build Version
Package Version
The package kl83/yii2-rating-widget contains the following files
Loading the files please wait ....