Yii Framework Forum: [SOLVED] Star Rating - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[SOLVED] Star Rating Rate Topic: -----

#1 User is offline   chux 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 83
  • Joined: 16-September 10

Posted 20 May 2011 - 05:53 AM

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
Give a read to my blog.
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 20 May 2011 - 06:13 AM

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

#3 User is offline   chux 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 83
  • Joined: 16-September 10

Posted 20 May 2011 - 12:52 PM

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...
Give a read to my blog.
0

#4 User is offline   chux 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 83
  • Joined: 16-September 10

Posted 20 May 2011 - 12:56 PM

Solved. To the above, i have added
'minRating' => 0.5,


...and it works as expected. Thanks
Give a read to my blog.
0

#5 User is offline   Rohit Suthar 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 134
  • Joined: 12-May 14
  • Location:Mumbai, India

Posted 04 July 2014 - 07:23 AM

for best help follow this wiki -

Managing a star rating with the StarRating widget in Yii 2

and use Star Rating Yii Widget..
Thanks & regards,

ROHIT SUTHAR,
Mumbai(India)

Follow me - @rohisuthar

www.yiiframework.us



Don't be shellfish to click +1 button
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users