Yii 1.1: dzraty

A wrapper for jQuery Raty plugin

dzRaty is a wrapper for jQuery Raty, a plugin developed by Washington Botelho that generates a customizable star rating.

To get started, check http://yii.dezero.es/dzraty



  • Integration with CGridView as filter and data column
  • Upgraded to jQuery Raty 2.5.2


  • Initial commit


Requirements: jQuery and Yii framework 1.0 or above (tested on 1.1.12).

Extract downloaded file to your Yii application extensions folder (default: protected/extensions).


Edit mode

Using with an attribute model. weight is a sample attribute name

$this->widget('ext.DzRaty.DzRaty', array(
    'model' => $model,
    'attribute' => 'weight',

Using with a single input element

$this->widget('ext.DzRaty.DzRaty', array(
    'name' => 'my_rating_field',
    'value' => 3,

View / Read-only mode

$this->widget('ext.DzRaty.DzRaty', array(
    'name' => 'my_rating_field',
    'value' => 3,
    'options' => array(
        'readOnly' => TRUE,

Localization - i18n

dzRaty translates all translatable elements of jQuery Star plugin. You can place your own translation file under DzRaty/messages.

Current version contains translation files for spanish. You could simply duplicate and edit one of them.


Total 15 comments

#19644 report it
Arystosedes at 2015/10/29 02:55pm
dzhtml.php failed to open stream?

What is going on? What is dzhtml.php? I can't find that file :( HELP!

#19197 report it
asifrafeeq at 2015/04/12 03:57am
can i use multi dzraty widget in one view

can i use dzraty many times in one view, if yes how?

#19196 report it
asifrafeeq at 2015/04/12 03:56am
action in controller for dzraty

how can i attach the extension to the action in controller, means how can i use dzraty with database.

#18181 report it
Ackley at 2014/09/22 09:03am
Rating directly on CGridView


Could anyone please explain how we could assign rating value directly on CGridView for each item? Thank you!

#16128 report it
Ibrar Turi at 2014/01/22 02:24am

Nice work!

#12869 report it
spatan at 2013/04/17 04:33am
dzRaty conflicting with yii jquery.. Am using yii version 1.8


Please how did you resolve the dzRaty jquery confilct. I could not get it work.

#12726 report it
Fabián at 2013/04/08 02:13pm
@Jales Monteiro

I've never checked dzRaty in CListView.

Thanks for reporting. I'll fix it soon.

#12713 report it
Jales Monteiro at 2013/04/07 04:51pm

break in pagination in clistview :(

#12550 report it
skworden at 2013/03/28 03:04am

My js was conflicting with raty's js making the js line where it hides the field not a valid statement...got it solved thanks.

#12528 report it
Fabián at 2013/03/26 01:42pm

That's why jQuery Raty plugin isn't running for this field. I don't know the reason... maybe jQuery Raty library is not loading in HTML document. Have you checked you have write permissions in assets folder? Do you have any Javascript error in your browser console? This can give you a clue.

#12456 report it
skworden at 2013/03/22 12:39am
Text Text Field


I tried to use this but it just show a text field with star rating number in it instead of stars. Any ideas why?

#11912 report it
Fabián at 2013/02/12 05:32pm

You have several ways to save the rating in database: using an attribute model or in a custom CForm (see examples above). If your dzRaty returns a numeric value, you should save it on a FLOAT or INT database column. Or if you configure it to return a string value, so you must use a VARCHAR or similar.

This plugin works like a normal text field. In fact, it saves the value in a hidden input text element.

#11908 report it
beesho at 2013/02/12 02:55pm
Save User Rating

Hello, Thank you for this extension. My question is how to save user ratings to database?

#11901 report it
Fabián at 2013/02/12 04:45am

Thanks for your comments > @Raoul.

I'm thinking now about integrating it with CgridView as filter and data column.

#11900 report it
Raoul at 2013/02/12 04:01am

impressive homepage (I wish all extension would have such dedicated homepage).. I'll definitly try this extension !

Good job

Leave a comment

Please to leave your comment.

Create extension