diff --git a/MultiSelect.php b/MultiSelect.php index 5242660..058eaef 100755 --- a/MultiSelect.php +++ b/MultiSelect.php @@ -1,8 +1,8 @@ options['id'] = $this->id; } if ($this->selectAll) - echo Html::a(\Yii::t('backend', 'select all'), '#', ['id' => $this->id . '-select-all']); + echo Html::a(\Yii::t('app', 'select all'), '#', ['id' => $this->id . '-select-all']); if ($this->deselectAll) - echo Html::a(\Yii::t('backend', 'deselect all'), '#', ['id' => $this->id . '-deselect-all']); + echo Html::a(\Yii::t('app', 'deselect all'), '#', ['id' => $this->id . '-deselect-all']); MultiSelectAsset::register($this->getView()); + if (isset($this->model)) { $this->pluginOptions[] = $this->model->{$this->attribute}; echo Html::activeDropDownList($this->model, $this->attribute, $this->data, $this->options); @@ -58,7 +59,7 @@ public function registerJsScript() });"; \Yii::$app->view->registerJs(" - $('#" . $this->id . "').multiSelect({$pluginOptions}); + $('#" . $this->id . "').multiSelect({$pluginOptions}); " . $addJsScript, View::POS_END); } -} \ No newline at end of file +}