Display Multiple CStarRating in 1 View

Hello all,

I have a view where several reviews are displayed for a product. Each review was initially submitted with a title, review content, and through CStarRating a rating value. All of this data is saved successfully.

In the view for the product I am displaying each review for this product(same information is shown - review title, review content, and review rating).

The problem I am having though is I can display the numerical value of the rating just fine however when I try to display the value rendered through CStarRating for each review only one CStarRating is rendered correctly (the first one) all of the others are missing their data.

The code in my foreach loop is:

	<div class="rating">

		Rating: <?php echo $review->rating;?>

		<?php $this->Widget('CStarRating',array(

			'id'=> 'rating'.$review->id,



			'value'=> $review->rating,








What is the proper syntax to display the value of multiple ratings?

P.s. I’ve searched high and low and am surprised to not have found any documentation/questions regarding displaying the data - only inserting the data.

Still haven’t had any luck on this…

When there are several reviews on one page it’s behavior is acting really strangely.

The first review may have its data populated correctly. Then there may be several blank cstarrating controls and then randomly there will be 10 radio boxes in a line…

Is CStarRating really only for input and not output?