Hi folks, sorry for my next question ;(
But I trief to find the ansrer in the forums, on this website. But I cant get the compare validate to work…
Here is the model class:
<?php
class User extends CActiveRecord
{
public $password_repeat;
public $email1_repeat;
public $tags;
/**
* Returns the static model of the specified AR class.
* @return CActiveRecord the static model class
*/
public static function model($className=__CLASS__)
{
return parent::model($className);
}
/**
* @return string the associated database table name
*/
public function tableName()
{
return 'User';
}
/**
* @return array validation rules for model attributes.
*/
public function rules()
{
return array(
array('username','length','max'=>10, 'min'=>2),
array('username', 'unique', 'caseSensitive' => 'false'),
array('password','length','max'=>30),
array('email1','length','max'=>30),
array('email1', 'email'),
array('username, password, email1', 'required'),
array('username', 'unique'),
array('password_repeat', 'required', 'on'=>'register'),
array('password', 'compare', 'on'=>'register'),
);
}
/**
* @return array relational rules.
*/
public function relations()
{
return array(
);
}
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'username'=>'Username',
'password'=>'Password',
'email1'=>'Primary E-Mail',
'id'=>'Id',
'referral'=>'Referral',
'uuid' => 'uuid',
'password_repeat' => 'Repeated password'
);
}
}
Well and in the view i use password_repeat… I tested to set compareAttribute. But this doesnt help too ;(
It displays every time that I have to repeat the password…
Ups something went wrong before ^^