I have a simple question about the best way to model and control the process of having a user sign up.
Basically I have a User table which extends CActiveRecord. Should I be using this same model in the sign up form, or should I create a SignUpFormModel?
I ask because the form contains a number of fields which are not in the User DB table (e.g. password2 to compare etc.) Is there a clean way of having fields in the CActiveRecord model which are not to be persisted to the DB… Or do I have to manually reference these fields using $_POST etc.
Yes, you can use your User AR to collect signup information. You may declare those additional fields as public members of this AR class. Make sure you override safeAttributes() to specify these additional members as safe attributes.