我正在尝试编辑表单,以便在打开表单时为我选择了一个单选按钮。我已经尝试了几个选项,并且已经选择了按钮,但是在提交表单时,就好像未选中单选按钮一样。
有什么想法吗?
<div class="col-md-<?php $this->Html->_($column_widths);?>">
<h4><?php echo $this->Html->ifSet($options_heading);?></h4>
<?php
// Set non-merchant gateways
foreach ($this->Html->ifSet($nm_gateways, []) as $gateway) {
?>
<div class="radio">
<label>
<?php
$this->Form->fieldRadio('gateway', 'checked', $this->Html->ifSet($gateway->id), ($this->Html->ifSet($vars->pay_with) == $this->Html->ifSet($gateway->id)), ['class' => 'gateway']);
$this->Html->_($gateway->name);
?>
</label>
</div>
<?php
}
?>
</div>