|
|
|
@ -14,12 +14,15 @@ class NotificationCountWidget extends Widget
|
|
|
|
|
public function run() |
|
|
|
|
{ |
|
|
|
|
$count = 0; |
|
|
|
|
foreach (\Yii::$app->params['notifications'] as $notification) { |
|
|
|
|
|
|
|
|
|
if (isset(\Yii::$app->params['notifications'])) { |
|
|
|
|
foreach ( \Yii::$app->params['notifications'] as $notification ) { |
|
|
|
|
$count += $notification['count']; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->render('notification-count', [ |
|
|
|
|
'notifications' => \Yii::$app->params['notifications'], |
|
|
|
|
'notifications' => isset(\Yii::$app->params['notifications']) ? \Yii::$app->params['notifications'] : [], |
|
|
|
|
'count' => $count, |
|
|
|
|
]); |
|
|
|
|
} |
|
|
|
|