[SOLVED] Star Rating


(Djchux) #1

Hi,

I have implemented a star system to my page using the CStarRating class. Was very quick and easy. BUT, the plugin that uses, don’t support non int ratings.

I mean, y have 2 votes, one 5 stars, the second 4 stars… the result is 4.5. CStarRating doesn’t support that, it only accepts integer as values.

Anyone know any extension that support that? at least, show a half star.

Thanks


(Matteo Falsitta) #2

CstarRating can do half of star, try playing around the properties ratingStepSize, maxRating and minRating


(Djchux) #3

Thanks for reply. With this




'starCount' => 10,

'maxRating' => 10,

'ratingStepSize' => 0.5,

'value' => 2.5,



i see 20 stars (0.5 value each) and the first 5 are selected (cause of 0.5 rating step).

Are you sure that i can show half star? can you please post an example? I’m looking at the plugin documentation page and i see that value has to be a integer…


(Djchux) #4

Solved. To the above, i have added




'minRating' => 0.5,



…and it works as expected. Thanks


(Rohisuthar) #5

for best help follow this wiki -

Managing a star rating with the StarRating widget in Yii 2

and use Star Rating Yii Widget…