I have another problem. I have to tables: 1 - with users 2 - with groups. Tables are connected with id of groups - groupid from table 1 is connected with id of group from table 2.
I wanted to create list of options using this code:
echo $this->Form->input('Priority', array(
'label' => 'Group',
'options' => $groups_array
));
Now the $group_array should look
like array('1' => 'Admin', '2' => 'User');
I've tried to push group id and group name via this code, but it doesn't work properly (it adds group with ID lowered by 1 - i assume that the ID isn't id of group but ID of name position in array $group_array.
$groups_array = array();
foreach($groups as $group):
echo $group['Group']['ID']; echo $group['Group']['Name'];
array_push($groups_array, $group['Group']['ID']=$group['Group']['Name']);
endforeach;
How can i fix that?