Two Models For A Single Table

Can i have 2 models for a single table in YII.

I have a table which is storing login and registration info in one table.However i have 2 forms. One for login and one for registration. so i want to create 2 models, for login and registration.

I do agree that we need 2 tables, login and registration.

However in case if i want to do, is it possible to have 2 models pointing to single table?

Thanks to all

yes you can have two models but an easy aproach would be use one single model and have to different actions one for registration one for login.

Yes, I’ve used the default login and created user model to control creation, updating etc. Just configure default login to use your own authentication and implement sql to get user data.

ok if you have that in place create another action in your controller for you registration and handle your registion in that action simple solution. But you can still create a separate model for registration if thats what you want.

Thanks to all…

I would prefer the separate model approach for reason of separation of logic.

cheers