2017 © Pedro Peláez
 

library yii2-rating-widget

Allows you to set an stars-rating for something or show it.

image

kl83/yii2-rating-widget

Allows you to set an stars-rating for something or show it.

  • Saturday, April 21, 2018
  • by kl83
  • Repository
  • 2 Watchers
  • 1 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 17 % Grown

The README.md

Yii2 rating widget

Latest Stable Version Total Downloads License, (*1)

Allows you to set an stars-rating for something or show it., (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require kl83/yii2-rating-widget ^2.0

or add, (*5)

"kl83/yii2-rating-widget": "^2.0"

to the require section of your composer.json file., (*6)

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., (*7)

~~~ php \kl83\widgets\RatingWidgetFaAsset::register(\Yii::$app->view);, (*8)


### Input widget ~~~ php $form->field($model, 'rating')->widget('kl83\widgets\RatingInput', [ 'containerOptions' => ['class' => 'some-class'], // HTML attributes 'maxRating' => 10, // stars count, default - 5 ]);

~~~ javascript // Sets 5 stars rating jQuery('.widget').ratingInput('set', 5);, (*9)


### Display widget ~~~ php \kl83\widgets\RatingWidget::widget([ 'maxRating' => 10, // stars count, default - 5 'options' => ['class' => 'some-class'], // HTML attributes 'value' => 4.5, // highlighted stars count ]);

~~~ javascript // Initialize widget jQuery('.widget').ratingWidget(); // Sets 5 stars rating jQuery('.widget').ratingWidget('set', 5); ~~~, (*10)

License

MIT License, (*11)

The Versions

21/04 2018

dev-master

9999999-dev

Allows you to set an stars-rating for something or show it.

  Sources   Download

MIT

The Requires

 

by Aleksandr Solovyov

26/08 2017

v1.0.5

1.0.5.0

Allows you to set an stars-rating for something or show it.

  Sources   Download

MIT

The Requires

 

by Aleksandr Solovyov

02/07 2017

v1.0.4

1.0.4.0

Allows you to set an stars-rating for something or show it.

  Sources   Download

MIT

The Requires

 

by Aleksandr Solovyov

02/07 2017

v1.0.3

1.0.3.0

Allows you to set an stars-rating for something or show it.

  Sources   Download

MIT

The Requires

 

by Aleksandr Solovyov

02/07 2017

v1.0.2

1.0.2.0

Allows you to set an stars-rating for something or show it.

  Sources   Download

MIT

The Requires

 

by Aleksandr Solovyov

02/07 2017

v1.0.1

1.0.1.0

Allows you to set an stars-rating for something or show it.

  Sources   Download

MIT

The Requires

 

by Aleksandr Solovyov

02/07 2017

v1.0.0

1.0.0.0

Allows you to set an stars-rating for something or show it.

  Sources   Download

MIT

The Requires

 

by Aleksandr Solovyov