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
Page 1 of 1
Two Models For A Single Table two models for a single table
#2
Posted 08 December 2012 - 05:32 AM
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.
#3
Posted 08 December 2012 - 05:37 AM
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.
#4
Posted 08 December 2012 - 05:44 AM
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.
#5
Posted 08 December 2012 - 08:15 AM
Thanks to all...
I would prefer the separate model approach for reason of separation of logic.
cheers
I would prefer the separate model approach for reason of separation of logic.
cheers
alirz23, on 08 December 2012 - 05:44 AM, said:
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.
Share this topic:
Page 1 of 1

Help











