Thanks a lot for the explanation.
The last point, I've to put also the refresh into the model ?
in this way:
class UserRegisterModel extends UserModel{
public function __construct($db,UserRegisteValidator $validator){
parent::__construct($db,$validator);
}
public function register(){
if($this->validator->isValid()){
$sql= "INSERT INTO users (user_ID, user_nick,user_name, user_password,user_email, user_confirm, user_is_admin, user_date, user_uid)
VALUES(NULL,:usernick,:username,MD5(:password),:email,'0','0',NOW(),:uid)";
$sth= $this->db->prepare($sql);
$excute= array(
':usernick'=>$this->validator->data->nickname,
':username'=>$this->validator->data->username,
':password'=>$this->validator->data->password,
':email'=>$this->validator->data->email,
':uid'=>$this->validator->data->uid
);
$sth->execute($excute);
refresh('login.php');
return new UserPage(new UserConfirmView(SENT_EMAIL));
}
else{
refresh('register.php');
return new UserPage(
new UserErrorView(
$this->validator->getErrors()
)
);
}
}
}
Bye.