<?php
echo $this->Form->create('User');
$options = array('29'=>'Active charge','25'=>'computer');
$arr = array();
for($i=1;$i<= 2;$i++){
foreach ($options as $opt=>$val){
$arr[$opt][$val][$i] = $i;
}
}
pr($arr);
foreach ($options as $opt=>$val){
echo $this->Form->input("User.charge.".$opt, array(
'type' => 'select',
'multiple' => 'checkbox',
'options' =>$arr[$opt],
'label'=>false
));
}
echo $this->Form->end('Send');
?>
echo $this->Form->create('User');
$options = array('29'=>'Active charge','25'=>'computer');
$arr = array();
for($i=1;$i<= 2;$i++){
foreach ($options as $opt=>$val){
$arr[$opt][$val][$i] = $i;
}
}
pr($arr);
foreach ($options as $opt=>$val){
echo $this->Form->input("User.charge.".$opt, array(
'type' => 'select',
'multiple' => 'checkbox',
'options' =>$arr[$opt],
'label'=>false
));
}
echo $this->Form->end('Send');
?>
No comments:
Post a Comment