You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
443 B
26 lines
443 B
6 years ago
|
<?php
|
||
|
/**
|
||
|
* Created by Error202
|
||
|
* Date: 13.08.2018
|
||
|
*/
|
||
|
|
||
|
namespace backend\widgets;
|
||
|
|
||
|
|
||
|
use yii\base\Widget;
|
||
|
|
||
|
class NotificationCountWidget extends Widget
|
||
|
{
|
||
|
public function run()
|
||
|
{
|
||
|
$count = 0;
|
||
|
foreach (\Yii::$app->params['notifications'] as $notification) {
|
||
|
$count += $notification['count'];
|
||
|
}
|
||
|
|
||
|
return $this->render('notification-count', [
|
||
|
'notifications' => \Yii::$app->params['notifications'],
|
||
|
'count' => $count,
|
||
|
]);
|
||
|
}
|
||
|
}
|