Formatting CJuiDatePicker value

I just found out that the value property is ignored when the attribute property is defined. Although this does make sense it is not documented. In other cases (e. g. CDataColumn) an exception is thrown when two excluding properties are defined. I think this could be the way to go here as well.



$this->widget('zii.widgets.jui.CJuiDatePicker', array(


	// 'attribute' => 'start', // Needs to be commented out for the value property to work


	'value' => date("d.m.Y",$model->start), // attribute may not be defined to use value




It’s a common Yii logic used in many components

If you define the model then you use attribute as those two gets hand in hand.

If you don’t have a model than you use value.

Since I’m quite new to Yii I did not know that. I know it seems redundant but I think it should be documented at every occurance and the exception should be thrown as described above. This would help a lot and save much time and thus making Yii more attractive for developers.