I’m actually using giix to create my models and cruds but when you and seenivasan asked about this basic things my first reaction was to test again using only standard gii.
Using gii the float value 23 is printed as 23 but the value is still the "23" string in the attributes collection of my model. The integer id is a String too but taken account of other posts in this forum that is correct.
I should repeat the same test using gii over mssql server.
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('floatCol', 'required'),
array('floatCol', 'numerical'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, floatCol', 'safe', 'on'=>'search'),
);
}
I looking deeper in my mssql server tests and al float values are strings too in the attributes collection as one can see from this debugger screenshot. I think that I’m becoming a little nervous with this issue but is too strange for me how this is managed by ar.
In other post I have read about the posibility of using the MySQL native driver to get the PHP native types and not plain strings but I have not tested this yet.
So if you make any progress on this I will be interested.