CakePHP表单操作按钮

时间:2012-12-11 01:02:43

标签: cakephp

我正在尝试将非表单相关按钮放入视图中以注册按钮,以引导人们进行控制器操作,但我仍然会收到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();
?>

1 个答案:

答案 0 :(得分:2)

$form->button是CakePHP 1.2语法,$this->Form是1.3以上。