Commits

Bogdan Savluk committed 5e65b1e

fixed bug when using as input widget(with model and attribute params)

Comments (0)

Files changed (1)

         if (isset($this->htmlOptions['name']))
             $name = $this->htmlOptions['name'];
 
+        if ($this->multiple && substr($name, -2) !== '[]')
+            $name .= '[]';
+
         if (isset($this->model)) {
-            echo CHtml::dropDownList($name, $this->model->{$this->attribute}, $this->data, $this->htmlOptions);
+            echo CHtml::dropDownList($name, CHtml::value($this->model, $this->attribute), $this->data, $this->htmlOptions);
         } else {
             echo CHtml::dropDownList($name, $this->value, $this->data, $this->htmlOptions);
         }