Skip to content

Commit 7a46d6d

Browse files
committed
Make FlashAlert widget array compatible (Close #13)
1 parent a4b9b84 commit 7a46d6d

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Yii2 Gentelella Change Log
44
1.3.0 Under development
55
-----------------------
66

7+
- Fix #13: Make FlashAlert widget array compatible (al.gushchin)
8+
79
1.2.0 August 1, 2016
810
--------------------
911

widgets/FlashAlert.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,16 @@ public function run()
6969
(isset($alert['icon']) ? new Icon($alert['icon']) . ' ' : '') . $alert['header']
7070
);
7171
}
72-
echo Alert::widget(
73-
[
74-
'body' => $header . Yii::$app->session->getFlash($flashName),
75-
'options' => [
76-
'class' => 'alert alert-' . $alert['class'],
77-
],
78-
]
79-
);
72+
foreach ((array) Yii::$app->session->getFlash($flashName) as $message) {
73+
echo Alert::widget(
74+
[
75+
'body' => $header . $message,
76+
'options' => [
77+
'class' => 'alert alert-' . $alert['class'],
78+
],
79+
]
80+
);
81+
}
8082
}
8183
}
8284
echo Html::endTag('div');

0 commit comments

Comments
 (0)