Skip to content

Commit

Permalink
Fixes #1 and #2
Browse files Browse the repository at this point in the history
  • Loading branch information
bubasuma committed Jan 8, 2016
1 parent aa661f2 commit 70c0c13
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MessageWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 70c0c13

Please sign in to comment.