Calling function register with error
Hello,
i have got function with name register, that is used for get values from register form and insert into database.
function register()
{
if (!empty($this->data)) {
$this->User->create();
if ($this->User->saveAll($this->data)) {
$this->Session->setFlash('List saved');
$this->redirect(array('action'=>'index'), null, true);
} else {
$this->Session->setFlash('List could not be saved');
$this->redirect(array('action'=>'register'), null, true);
}
}
}
but, if i key in data into form and click on the button, is displayed error message with>>
Error: The view for UsersController::add() was not found.
But i don't want to use add method in this case. Only register, is it posssiblel, or what i am doing wrong?
Thanks for any reply.
Asked by blacksymmetry, on 8/2/10
1 Answer
your form must have
$form->create('User', array('action'=>'register'));
Answered by dogmatic69on 8/2/10
<< comments | comments >>
<< previous next >>
Tagged with
Rating
0
Viewed
320 times
Last Activity
on 8/2/10
Check your from action, You can create it like this
$form->('Register', array('url' =>array('controller' => 'users', 'action' => 'register')));
satish - on 8/2/10