当我获取$selected
变量中的值时,我必须显示复选框。目前在下面的场景中,我必须显示两个复选框已选中,但我的代码不起作用。我该如何解决?
$checkboxarray = [
'0' => "By Value",
'1' => "By Quantity",
'2' => "By Date"
];
$selected = explode(",", "0,1");
echo $this->Form->select('mo_type', $checkboxarray, array( 'selected' => $selected, 'multiple' => 'checkbox'));