CakePHP multiple select “selected” is not working
问题 I have a multiple select input in my edit form:- <?php echo $this->Form->input('Article.tags', array('type' => 'select', 'multiple' => true, 'options' => $tags, 'selected' => array($selected))); ?> When echo-ed, the $selected variable will look like this:- "MySQL", "PHP" However, the input does not automatically select the option that matches the tag. However, when I manually put in the selected option, it will automatically select that two option; e.g. <?php echo $this->Form->input('Article