我的问题是;是否可以为 Zend 表单上的每个单选按钮添加唯一的标题属性?
到目前为止,我的代码是:
$this->addElement('radio', 'vtype', array('label'=>'Type of Visit:'));
$vtype = $this->getElement('vtype');
$vtype->addMultiOption("A","A");
$vtype->addMultiOption("B","B");
$vtype->addMultiOption("C","C");
$vtype->addMultiOption("D","D");
$vtype->addMultiOption("E","E");
$vtype->setAttribs(array('label_class'=>'radio_label'));
$vtype->setSeparator("");
$vtype->setDecorators($myDecorators);
更新 - 如果可能的话,这就是我想要实现的目标:
<input type="radio" name="vtype" title="Click A for some reason" value="A" />
...
<input type="radio" name="vtype" title="Click E for some reason" value="E" />