Skip to content

Commit

Permalink
Implement multiple mode aka Tags mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefano Mtangoo committed Sep 29, 2024
1 parent 8f4c837 commit a532771
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Select2.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public function run()
$this->registerPlugin('select2');
Html::addCssClass($this->options, 'form-control');

if (isset($this->options['multiple']) && $this->options['multiple']) {
unset($this->options['multiple']);
$this->options['multiple'] = 'multiple';
}

if ($this->hasModel()) {
return Html::activeDropDownList($this->model, $this->attribute, $this->items, $this->options);
} else {
Expand Down

0 comments on commit a532771

Please sign in to comment.