Signup And Login Inputs In A Single Form

Is it possible to create Login / Sign-Up in one signle form

Has anyone seen any good examples of a Login / Sign-Up in one signle form, uses for both existing users to login and for new members to start a registration process?

Thanks !!!

Yes it’s so easy…you can create the custome model with extends CForm model.

please see forum

I hope it’s some help.


But, is it possible to display the login section in the top of the page(in header section), and sign-in form at right side of the page(in body). for example like facebook

put this on header

$model=new LoginForm;

$this->renderPartial('//site/login', array('model'=>$model));

on body part

$model1=new User;

$this->renderPartial('//user/create', array('model'=>$model1));

Try this…may works

you can create a single model(LoginForm) and add a scenario on rules function

like login page

array('username, password', 'required', 'on'=>'login'),

array('username, password,email,phone_no', 'required', 'on'=>'register'),

if user login then username and password is requiired

$model = new LoginForm('login')

$this->renderPartial('//user/login', array('model'=>$model));

and if user register then some other field validation.

$model = new LoginForm('register')

$this->renderPartial('//user/create', array('model'=>$model));

I hope you can understand me.

thank you!

Maggie Q(Ankit Modi) and Balu, in both scenario it works fine…