情况如下:
我有stages
具有以下结构的表
| id | name | editable|
-----------------------------------------------------------------------------
| open | Open | 1 |
| paysheet_review | Paysheet Submitted (Awaiting Office Approval) | 0 |
| to_pay | Paysheet Approved (Awaiting Payment) | 0 |
| paid | Paid | 1 |
| purgatory | Flip or Refund | 0 |
| closed | Deal Closed | 1 |
-----------------------------------------------------------------------------
我正在创建一个多个复选框块
在控制器中
<?php $_stages = $this->Stage->find("list");?>
在视图中
<?php echo $this->Form->input("stage", array("multiple" => "checkbox", "options" => $_stages));?>
创建以下html
<div class="control-group">
<label class="control-label" for="DealStage">Stage</label>
<input type="hidden" value="" id="DealStage_" name="data[Deal][stage]">
<div class="controls">
<label class="checkbox"><input type="checkbox" id="DealStageOpen" value="open" name="data[Deal][stage][]">Open</label>
<label class="checkbox"><input type="checkbox" id="DealStagePaysheetReview" value="paysheet_review" name="data[Deal][stage][]">Paysheet Submitted (Awaiting Office Approval)</label>
<label class="checkbox"><input type="checkbox" id="DealStageToPay" value="to_pay" name="data[Deal][stage][]">Paysheet Approved (Awaiting Payment)</label>
<label class="checkbox"><input type="checkbox" id="DealStagesPaid" value="paid" name="data[Deal][stage][]">Paid</label>
<label class="checkbox"><input type="checkbox" id="DealStagePurgatory" value="purgatory" name="data[Deal][stage][]">Flip or Refund</label>
<label class="checkbox"><input type="checkbox" id="DealStageClosed" value="closed" name="data[Deal][stage][]">Deal Closed</label>
</div>
</div>
现在我想将editable
from Database 列作为每个复选框的标题传递。有什么方法可以multiple checkbox
在 CakePHP 中创建一个并title
为每个输入类型复选框添加一个 as 属性。这样我就可以只使用jQuery
可check OR uncheck
编辑的阶段。