Created
January 20, 2017 12:17
-
-
Save thyseus/ca215c95bc77e56f45225a8ae316c4f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foreach (Yii::$app->session->getAllFlashes() as $message):; ?> | |
| <?php | |
| if ($message) { | |
| if (is_array($message)) | |
| echo \kartik\widgets\Growl::widget([ | |
| 'type' => (!empty($message['type'])) ? $message['type'] : 'danger', | |
| 'title' => (!empty($message['title'])) ? $message['title'] : 'Title Not Set!', | |
| 'icon' => (!empty($message['icon'])) ? $message['icon'] : 'fa fa-info', | |
| 'body' => (!empty($message['message'])) ? $message['message'] : 'Message Not Set!', | |
| 'showSeparator' => true, | |
| 'delay' => 0, //This delay is how long before the message shows | |
| 'pluginOptions' => [ | |
| 'offset' => ['y' => 70, 'x' => 0], | |
| 'delay' => (!empty($message['duration'])) ? $message['duration'] : 3000, //This delay is how long the message shows for | |
| 'placement' => [ | |
| 'from' => (!empty($message['positonY'])) ? $message['positonY'] : 'top', | |
| 'align' => (!empty($message['positonX'])) ? $message['positonX'] : 'right', | |
| ] | |
| ] | |
| ]); | |
| else | |
| echo \kartik\widgets\Growl::widget([ | |
| 'type' => (!empty($message['type'])) ? $message['type'] : 'warning', | |
| 'title' => 'Nachricht: ', | |
| 'icon' => 'fa fa-info', | |
| 'body' => $message, | |
| 'showSeparator' => true, | |
| 'delay' => 0, | |
| 'pluginOptions' => [ | |
| 'offset' => ['y' => 70, 'x' => 0], | |
| 'delay' => 2000, | |
| 'placement' => [ | |
| 'from' => 'top', | |
| 'align' => 'right', | |
| ] | |
| ] | |
| ]); | |
| } | |
| ?> | |
| <?php endforeach; ?> | |
| foreach (Yii::$app->session->getAllFlashes() as $message):; ?> | |
| <?php | |
| if ($message) { | |
| if (is_array($message)) | |
| echo \kartik\widgets\Growl::widget([ | |
| 'type' => (!empty($message['type'])) ? $message['type'] : 'danger', | |
| 'title' => (!empty($message['title'])) ? $message['title'] : 'Title Not Set!', | |
| 'icon' => (!empty($message['icon'])) ? $message['icon'] : 'fa fa-info', | |
| 'body' => (!empty($message['message'])) ? $message['message'] : 'Message Not Set!', | |
| 'showSeparator' => true, | |
| 'delay' => 0, //This delay is how long before the message shows | |
| 'pluginOptions' => [ | |
| 'offset' => ['y' => 70, 'x' => 0], | |
| 'delay' => (!empty($message['duration'])) ? $message['duration'] : 3000, //This delay is how long the message shows for | |
| 'placement' => [ | |
| 'from' => (!empty($message['positonY'])) ? $message['positonY'] : 'top', | |
| 'align' => (!empty($message['positonX'])) ? $message['positonX'] : 'right', | |
| ] | |
| ] | |
| ]); | |
| else | |
| echo \kartik\widgets\Growl::widget([ | |
| 'type' => (!empty($message['type'])) ? $message['type'] : 'warning', | |
| 'title' => 'Nachricht: ', | |
| 'icon' => 'fa fa-info', | |
| 'body' => $message, | |
| 'showSeparator' => true, | |
| 'delay' => 0, | |
| 'pluginOptions' => [ | |
| 'offset' => ['y' => 70, 'x' => 0], | |
| 'delay' => 2000, | |
| 'placement' => [ | |
| 'from' => 'top', | |
| 'align' => 'right', | |
| ] | |
| ] | |
| ]); | |
| } | |
| ?> | |
| <?php endforeach; ?> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yii::$app->getSession()->setFlash('warning', [
'type' => 'warning',
'duration' => 5000,
'icon' => 'fa fa-users',
'title' => 'Achtung!',
'message' => 'Sie haben ' . $unread . ' ungelesene Nachrichten in ihrem Postfach.
'
. Html::a('Zum Postfach', ['/message/message/inbox']) . '
'
. Html::a('Alle als gelesen markieren', ['/message/message/mark-all-as-read']),
]);