This blog summarizes a plenty of programming tricks coming from Allen's practical project experiences, including PHP, C#, Java, Yii Framework, Lucene...
Sunday, 1 April 2012
Yii framework: difference between radioButtonList and activeRadioButtonList
In Yii there is a "regular" and "active" version of (almost?) every CHtml form field helper/widget. With the "active" version you pass in the ActiveRecord Model and the Attribute you want to make a form field for. This ties the ActiveRecord model more closely to the form field which helps with a few things like:
applying the model->attribute's validation rules (especially ajax validation)
building the proper form $_POST structure for model->attribute assignments
getting the proper field label
Use activeRadioButtonList if you are building a form for an ActiveRecord model, and use radioButtonListif you are building a regular form (for a CFormModel model).