2
所以我有這種形式來添加報告,我的報告有很多措施。我的問題是,我想將「度量」的顯示「拆分」爲組(度量屬於一個組)。多個輸入分組
我有這樣的:
//Controller/Report/add
$measures = $this->Report->Measure->find('list');
這:
//View/Report/add.ctp
echo $this->Form->input('Measure', array('label' => false, 'multiple' => 'checkbox'));
此輸出:
<div class="input select">
<input type="hidden" name="data[Measure][Measure]" value="" id="MeasureMeasure"/>
<div class="checkbox">
<input type="checkbox" name="data[Measure][Measure][]" value="1" id="MeasureMeasure1" />
<label for="MeasureMeasure1">
...
</label>
</div>
....
</div>
不過,我需要這樣的東西:
<h2>Measure Group 1</h2>
<div class="input select">
<input type="hidden" name="data[Measure][Measure]" value="" id="MeasureMeasure"/>
<div class="checkbox">
<input type="checkbox" name="data[Measure][Measure][]" value="1" id="MeasureMeasure1" />
<label for="MeasureMeasure1">
...
</label>
</div>
....
</div>
<h2>Measure Group 2</h2>
<div class="input select">
<input type="hidden" name="data[Measure][Measure]" value="" id="MeasureMeasure"/>
<div class="checkbox">
<input type="checkbox" name="data[Measure][Measure][]" value="1" id="MeasureMeasure1" />
<label for="MeasureMeasure1">
...
</label>
</div>
....
</div>
達到此目的的最佳方法是什麼?
謝謝你的回答,讓我解決了問題:) –