我发现当我使用$ 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();
答案 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>';