Did you add the both [color="#FF0000"]confirm email:[/color] and [color="#FF0000"]confirm password:[/color] in to table.
Then you have to add the model and view files related to this table.It’s better if you can delete those files and folders and created the crud again.But you won’t do that let me know…I’ll tell where to edit…
just declare the two fields in your model so you can use them and validate them. but you will have to change your view file as well if you wish to use them. The easiest way is to use some of the ready-made user extensions
I have a look on yii user extension and i think it is complicated and will become a black box for me. I would like to build my yii app from ground up and step by step. This way i will understand my yii app 100%.
In my models/user.php i can’t figure out where i should add the two field. I tried adding to attributeLabels() but the field would not show.
And then i have a look at views/user/create.php and it has one line
seems that you haven’t read Yii’s guide, which covers form processing very well.
In your particular case first you need to add new public attributes to the model, then add validation rules for them, and after that add code to the view file (this will eliminate an exception of Property "User.RetypePassword" is not defined). The model should look like:
class YourModel extends CActiveRecord
{
//add these decarations
public $password_repeat;
public $email_repeat;
...
public function rules()
{
return array(
array('username, password', 'required'),
array('password_repeat, email_repeat', 'required', 'on'=>'register'),
array('password', 'compare', 'on'=>'register'),
array('email_repeat', 'required', 'on'=>'register'),
array('email', 'compare', 'on'=>'register'),
);
}
...
}
To better understand what is going on please also read documentation for CCompareValidator.