我是 Zend 的新手,我创建了一个简单的注册表单,但它有很多字段。所以我想在用户注册操作后创建一个确认页面。
这就是我的流程:注册->确认->成功/错误
我有一个单独的确认表单页面的主要原因是数据字段太多,因此用户必须通过以确保它们都正确填写。
使用表单注册和确认(禁用字段),我想知道是否有办法从注册表单中传递数据以确认表单?
欢迎任何有用的想法和建议;)
public function signupAction()
{
$users = new Application_Model_Users();
$form = new Application_Form_RegistrationForm();
$this->view->form=$form;
if($this->getRequest()->isPost()){
if($form->isValid($_POST)){
$data = $form->getValues();
//some checks before sending data to confirm page
//not sure how the data can be passed to the confirm page from here
$this->_redirect('auth/confirmsignup');
}
}
}
public function confirmsignupAction()
{
$users = new Application_Model_Users();
$form = new Application_Form_ConfirmRegistrationForm();
$this->view->form=$form;
if($this->getRequest()->isPost()){
if($form->isValid($_POST)){
$data = $form->getValues();
//some checks before
unset($data['confirmPassword']);
$users->insert($data);
$this->_redirect('auth/login');
}
}
}