I’m finally beginning to understand Yii bit by bit, but there still is something I don’t get what starts to irritate me.
While trying to understand the difference between CFormModel and CActiveRecord, which I don’t see, I’ve been playing around with some login and register examples. Right now I have 3 models, a LoginForm (CFormModel) from the Yii guide, a RegisterForm (CActiveRecord) and a User (CActiveRecord) model generated by Gii. If I understand it right, I can combine LoginForm and RegisterForm within the User model by using scenarios so there is only one model for all handlings. But what is just the best approach? Especially when being in a very large project…?
And why there actually is a difference between CFormModel and CActiveRecord if you can do the same with both (if I’m right). I’ve read something like one can only validate and the other can also save?
I’m very thankful to the one who can explain me the logic behind these beasts. Or someone can just post an example of the best model file structure/tree for common user related actions such as Login, Register, Forget password, Profile etc. which could help me understand everything a little better.
Big thanks in advance,