More automatic CHtml generation

I think there are some things that can be handled by the model and of course allow removing of some code duplicates.

Example:


public function rules() {

        return array(

            array('country','length','max' => 48),

            ...

And:


<?php echo $form->textField($model,'country',array('size'=>48,'maxlength'=>48)); ?>

In CHtml::activeform “size” and “maxlength” parameters should be automatically generated when modifying the model. So we’ll don’t have to redefine it in the view.

If i’m not mistaken, when you have a “length” rule with a “max” property, then you don’t need to add maxlength attribute to your html options, Yii does that for you.