CakePHP表单操作按钮

CakePHP表单操作按钮,cakephp,Cakephp,我正在尝试将一个与表单无关的按钮放置到注册按钮的视图中,以将人们引导到控制器操作,但我继续得到error500内部错误。你知道我做错了什么吗 <?php echo $this->Form->create('User'); echo $this->Session->flash(); echo $this->Form->input('username', array('label' => false, 'div' => false, 'clas

我正在尝试将一个与表单无关的按钮放置到注册按钮的视图中,以将人们引导到控制器操作,但我继续得到error500内部错误。你知道我做错了什么吗

<?php 
echo $this->Form->create('User');
echo $this->Session->flash();
echo $this->Form->input('username', array('label' => false, 'div' => false, 'class' => 'w-icon validate[required]'));
echo $this->Form->input('password', array('label' => false, 'div' => false, 'class' => 'w-icon validate[required]'));
echo $form->button('Register', array('type' => 'button', 'class' => 'button red tiny'));
echo $this->Form->submit('Login', array('class' => 'button blue tiny'));
echo $this->Form->end();
?>


$form->button
是CakePHP1.2语法,
$this->form
是1.3以后的语法

谢谢你!如何使按钮指向控制器/操作而不是提交按钮?按钮不指向任何东西,而是提交表单。这就是HTML的工作原理。您可以使用链接转到其他内容$这个->Html->链接(…)的最终解决方案是echo$this->Form->button('Register',array('onclick'=>“location.href='/Register','class'=>'button red tiny'));