Somehow I need to use foreach loop to create my form from my Model (CActiveRecord).
So my form element order is depending on the attributes order.
The attributes order will mess up after the validation.
Lets say, print_r($model->attributes) for first time, the attributes order is like below,
Array ( [FirstName] => [LastName] => [PhoneNumber] => [Address] => )
After validation, print_r($model->attributes) again, the attributes order will become something like below,
Array ( [LastName] => [PhoneNumber] => [Address] => [FirstName] => )
This will make my form not consistent.
Any idea, how I can fix the attributes order?
Thank you.