我在 Ubuntu 10.0.4 上使用 Symfony 1.3.6。
我正在使用 sfWidgetFormSelectRadio 来允许用户从表单中的列表中选择图片。
在动作中,图片是这样设置的:
$this->form->setWidget('chosenpic', new sfWidgetFormSelectRadio(array(
'choices' => $this->pictures,
'default' => $this->pictures[count($this->pictures)-1] ))
);
在模板中,小部件显示如下:
<?php echo $form['chosenpic']->render(array('id'=>'check'.($i+1), 'value'=> ($i+1), 'width' => "80", 'height' => "80")); ?>
这会生成以下输出:
<ul class="radio_list"><li><input type="radio" width="80" height="80" id="check1" value="1" name="flowers[chosenpic]"> <label for="flowers_chosenpic_0">http://example.com/media/images/48408000/jpg/_48408794_009829449-1.jpg</label></li></ul>
我不希望标签出现,因为它弄乱了表格。没有自己手动生成 HTML(使用表单和小部件名称,有没有办法可以阻止小部件显示“标签”?