public function actionIndex() { $notifiche = GlobalNotification::getAllNotifications(); $number = 0; foreach ($notifiche as $notifica) { if($notifica->isNotReaded()) { $number = $number + 1; Yii::app()->user->setFlash('success' . ($number), $notifica->content); } } $this->render('index', array( 'notifiche' => $notifiche, )); }
<?php if ($notifica->isNotReaded()) { ?> <?php $count++; ?> <?php $notifications[$notifica->student_notification_id] = $notifica->student_notification_title; ?> <?php } ?> <?php } } $gnotifiche = GlobalNotification::model()->getAllNotifications(); ?> <?php $gnotifications = array(); ?> <?php $count2 = 0; ?> <?php foreach ($gnotifiche as $notifica) { ?> <?php if ($notifica->isNotReaded()) { ?> <?php