如何在
cakephp 中创建单选按钮并将图像附加到每个按钮? 甚至可能吗,我正在使用创建动态单选按钮列表
echo $this->Form->input('db.field', array('type' => 'radio', 'options' => $myOptions, 'label' => 'myLabel')); ?>
请帮忙吗?谢谢:D
您可以简单地将图像放在选项数组中:
$myOptions = array();
$myOptions['power'] = $this->Html->image('cake.power.gif');
$myOptions['icon'] = $this->Html->image('cake.icon.png');
echo $this->Form->input('db.field', array('type' => 'radio', 'options' => $myOptions, 'label' => 'myLabel')); ?>