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,
'name'=>'test'.$review->id,
'attribute'=>'rating',
'value'=> $review->rating,
'readOnly'=>true,
'minRating'=>.5,
'maxRating'=>5,
'starCount'=>5,
'ratingStepSize'=>.5,
));?>
</div>
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.