実際には、zend フレームワーク 2 がフォーム要素の HTML を生成する方法を理解できません。例えば、
$others = new Element\MultiCheckbox('others');
$others->setLabel('Others')
->setAttribute('name', 'others');
$others->setValueOptions(array(
'1' => 'Contacts',
'2' => 'Who viewd my profile'
));
このコードは生成します -
<label><input type="checkbox" value="1" name="others[]">Contacts</label>
<label><input type="checkbox" value="2" name="others[]">Who viewd my profile</label>
しかし、次のようにHTMLを作成する必要があります-
<input type="checkbox" value="1" name="others[]"><label>Contacts</label>
<input type="checkbox" value="2" name="others[]"><label>Who viewd my profile</label>
では、生成された HTML を変更したい場合、どうすればよいのでしょうか?