diff --git a/MessageWidget.php b/MessageWidget.php index e25904f..927db0e 100644 --- a/MessageWidget.php +++ b/MessageWidget.php @@ -75,7 +75,8 @@ public function registerJs() { $id = $this->options['id']; if (!isset($this->clientOptions['selector'])) { - $this->clientOptions['selector'] = '.' . strstr($this->itemOptions['class'], ' ', true); + $class = explode(' ', $this->itemOptions['class']); + $this->clientOptions['selector'] = '.' . $class[0]; } $this->clientOptions['form'] = '#' . $this->formOptions['id']; $options = Json::htmlEncode($this->clientOptions); @@ -141,7 +142,7 @@ public function renderItems() $models = $this->dataProvider->getModels(); $keys = $this->dataProvider->getKeys(); $rows = []; - foreach (array_reverse($models) as $index => $model) { + foreach (array_reverse($models, true) as $index => $model) { $rows[] = $this->renderItem($model, $keys[$index], $index); }