CakePHP Put Reset&在同一行上提交按钮

时间:2015-09-17 08:30:45

标签: php cakephp cakephp-2.0 cakephp-2.3

我发现当我使用$ this-> Form->提交时,提交按钮将包含在div.form-group中。

echo $this->Form->submit('submit', array(
            'div' => 'form-group',
            'class' => 'btn btn-primary'
));
echo $this->Form->button('Reset', array('type'=>'reset' ,'class' => 'btn btn-primary'));
echo $this->Form->end();

1 个答案:

答案 0 :(得分:4)

您可以将div设置为false以禁用两个按钮上的包装div,然后手动回显div:

echo '<div>';
echo $this->Form->submit('submit', array(
    'div' => false,
    'class' => 'btn btn-primary'
));
echo $this->Form->button('Reset', array(
    'type'=>'reset',
    'class' => 'btn btn-primary'
    'div' => false
));
echo '</div>';