我需要在 Zend 框架中设置我的复选框的样式,此时我的 zend 表单会像这样填充标签:
<dt id="disabled-label"><label for="disabled" class="optional">Disabled Access</label></dt>
<dd id="disabled-element">
<input type="hidden" name="disabled" value="0"><input type="checkbox" name="disabled" id="disabled" value="1"></dd>
我需要它输出:
残疾人通道下面是目前的 zend 形式,显然我只给出了上面 HTML 的较短版本:
public function searchForm() {
$sp = $this->createElement('checkbox', 'sw')
->setOptions(
array(
'label' => 'Swimming Pool',
)
);
$spa = $this->createElement('checkbox', 'spa')
->setOptions(
array(
'label' => 'Spa ',
)
);
$gym = $this->createElement('checkbox', 'gym')
->setOptions(
array(
'label' => 'Gym ',
)
);
$wifi = $this->createElement('checkbox', 'wifi')
->setOptions(
array(
'label' => 'Wifi ',
)
);
$parking = $this->createElement('checkbox', 'parking')
->setOptions(
array(
'label' => 'On-Site Parking ',
)
);
$golf = $this->createElement('checkbox', 'golf')
->setOptions(
array(
'label' => 'Golf ',
)
);
$wp = $this->createElement('checkbox', 'wp')
->setOptions(
array(
'label' => 'Wedding Packages ',
)
);
$cc = $this->createElement('checkbox', 'cc')
->setOptions(
array(
'label' => 'Civil Ceremonies ',
)
);
$city = $this->createElement('checkbox', 'city')
->setOptions(
array(
'label' => 'City Central ',
)
);
$oot = $this->createElement('checkbox', 'oot')
->setOptions(
array(
'label' => 'Out Of Town ',
)
);
$disabled = $this->createElement('checkbox', 'disabled')
->setOptions(
array(
'label' => 'Disabled Access ',
)
);
$submit = $this->createElement('submit', 'submit')
->setOptions
(array('label' => 'SEARCH OUR HOTELS',
'class' => 'f-left btn-purple icon'
));
$this->addElement($sp)
->addElement($spa)
->addElement($gym)
->addElement($wifi)
->addElement($parking)
->addElement($golf)
->addElement($wp)
->addElement($cc)
->addElement($city)
->addElement($oot)
->addElement($disabled)
->addElement($submit);
}
}