Forms Cakephp2表格不';t函数重定向到确认页面

Forms Cakephp2表格不';t函数重定向到确认页面,forms,validation,cakephp-2.0,Forms,Validation,Cakephp 2.0,我是这个社区的新手,我想问一下cakephp2的验证和表单。 我有一个名为input()的方法,该方法用于将forms变量发送到confirm页面。但问题是,即使我按下提交按钮,它也不会进入确认页面。 这是脚本,但我不知道它为什么起作用?如果你能帮我,那就太好了 public function input() { $this->title = 'contact'; if ($this->request->is('post')) {

我是这个社区的新手,我想问一下cakephp2的验证和表单。 我有一个名为input()的方法,该方法用于将forms变量发送到confirm页面。但问题是,即使我按下提交按钮,它也不会进入确认页面。 这是脚本,但我不知道它为什么起作用?如果你能帮我,那就太好了

public function input() {
    $this->title = 'contact';

    if ($this->request->is('post')) {
                //die(1);
        $data = arrayWithKeys(
            $this->request->data['Contact'],
            array('name', 'email', 'contact_category', 'message'));
        $this->Contact->set($data);
        $ret = $this->Contact->validates();
                     //die(3);
        if ($ret) {
            $this->Session->write(self::SES_CONTACT_INFO, $data);

            $this->redirect(array('controller' => 'contacts', 'action' => 'confirm'));
        } else {
            $this->Session->setFlash(
                $this->Contact->getValidationErrorsAsHtml(), 'error');
        }
                   // die(4);
    } else {
        $contact = $this->Session->read(self::SES_CONTACT_INFO);
        if ($contact) {
            $this->request->data['Contact'] = $contact;
        }
    }

    $this->set('contact_categories', $this->Contact->ContactCategory->find('list'));
}

对于auth,请设置如下示例所示的基础知识。对于重定向,请使用以下命令

$this->redirect(数组('action'=>edit',5))


我已经更改了设置,您提供的示例给了我一个操作提示!
// 1.Basic setup
$this->Auth->authenticate = array('Form');

// Pass settings in
$this->Auth->authenticate = array(
    'Basic' => array('userModel' => 'Member'),
    'Form' => array('userModel' => 'Member')
);

// Pass settings in using 'all'
$this->Auth->authenticate = array(
    AuthComponent::ALL => array('userModel' => 'Member'),
    'Basic',
    'Form'
);