why not 'options' => $categories ? since $categories probably is an array and contains the keys
On 10 Okt., 21:38, MetZ <met...@gmail.com> wrote: > Hi all. > > I am having trouble setting the selected to the options when selected > is an array. > > (This is a edit content view) > Dropdown display all categories (using generatetreelist to list my > categories) > > echo > $form->input('Content.category_id',array('selected'=>array($this->data['Content'] > > ['category_id']),'size'=>'10','div'=>false,'label'=>false,'type' => > 'select', 'multiple' => true,'options' => array($categories))); > > My array: $this->data['Content']['category_id'] = '4,5,6,7' > > Only the number 4 category option get "selected" in the dropdown. > > Anyone know if this is a bug or am I missing something here? I can not > see it, please help ;) > > Thanks all!! > -Tom -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php