Yii-User Registration Form

Hi:

I am new to yii, i have to develop a user Registration form, for this purpose i am using Yii-user and yii-Rights Extension,

I searched a lot, but did couldn’t found the solution,

Please suggest me some solution,

For Example: Already existing fields are UserName, Password, retype-Password, Email, FirstName, LastName and DOB,

but the fields required to me are,

  • UserName

  • FirstName

  • LastName

  • MiddleName

  • DateofBirth

  • EmailAddress

  • Address

  • City

  • State

  • Zip

  • Country

  • ContactNumber

how I have to change Model, Controller and View as well,

Please Reply, Thanks.

Alter the users table with new fields

Add new fields to the User,RegistrationForm models

in User Model

example

change According to your fields




public function defaultScope()

    {

        return CMap::mergeArray(Yii::app()->getModule('user')->defaultScope,array(

            'alias'=>'user',

            'select' => 'user.id, user.username, user.email, user.create_at, user.lastvisit_at, user.superuser, user.status, user.country, user.region, user.website_url,user.company_name, user.city, user.state, user.nationality, user.phone,user.address,user.zip_postal_code',

        ));

    }



also edit the rules




public function rules()

	{

		



Note that the RegistrationForm is extended from User


class RegistrationForm extends User {

Also Change the view forms according to your needs!!

thats it!!

http://www.yiiframework.com/wiki/423/installing-yii-users-and-rights-to-newly-created-yii-app/

Thanks Rajith R,

dear that not worked a lot, please tell me some in details,

Thanks.

whats the problem now?

One thing that I found now, that i should first setup smtp mail service,

Please tell me about this,

How to enable yii-user to send activation mail to newly registered users,

I have installed xampp in D:\xampp\ and my project lies @ D:\xampp\htdocs\project

after this step I think I will change what i needed,

Thanks…

configure your mail server.