User Model Vs Loginform


I’m a beginner to YII, that’s why I start my new dev with Yii2.

I don’t understand why you use a Model LoginForm when you want to show some forms for login/logout/register/… and don’t use the User Model directly ?

Thanks you

if you use activerecord in yii 1.1x it will make db connection, check the database or cache, but not for loginform. so saves time and resources


It can be done both ways: either you’re using User model + scenarios or a separate form model.

That I want to say. In all Exemple I see, there is no scenarios, only forms model.

is scenarios is "a very alpha state" ?

No, it’s not. Two examples are to show two possibilities.