【发布时间】:2011-10-06 21:31:43
【问题描述】:
我有一组简单的由 cakePHP 的表单生成的复选框
echo $form->input('Interest.interest_id', array('label' => __l('Interests'), 'multiple' => 'checkbox'));
有一个名为 Interests 的主标签,然后为每个生成的复选框生成一个标签,我如何将单独的类样式应用于复选框的标签?
片段
<label for="InterestInterestId">Interests</label>
<input type="hidden" value="" name="data[Interest][interest_id]">
<div class="checkbox">
<input id="InterestInterestId8" type="checkbox" value="8" name="data[Interest][interest_id][]">
<label for="InterestInterestId8">Label of Checkbox</label>
</div>
我的主要目标是让复选框在标签前很好地内嵌显示,但由于其他样式,它不会像默认那样显示
【问题讨论】:
-
你可以为这两种标签都包含一个 HTML 的 sn-p 吗?
-
@Allen - 我添加了一个 sn-p
标签: cakephp