public function actionTouch()
 {
     if ($id = \Yii::$app->request->post('id')) {
         return Notification::touch($id);
     }
 }
Beispiel #2
0
    foreach ($notifications->models as $notification) {
        ?>
                                <?php 
        /** @var $model Notification */
        ?>

                                <div class="<?php 
        echo Notification::getTypeAlertCss($notification->type);
        ?>
" role="alert" >
                                    <button type="button" class="close delete" data-dismiss="alert" aria-hidden="true" data-id="<?php 
        echo $notification->id;
        ?>
">&times;</button>
                                    <i class="icon <?php 
        echo Notification::getTypeCss($notification->type, false);
        ?>
"></i><?php 
        echo $notification->message;
        ?>
                                </div>
                            <?php 
    }
    ?>

                            <?php 
    echo \yii\widgets\LinkPager::widget(['pagination' => $notifications->pagination]);
    ?>

                        <div class="modal-footer">
                            <button type="button" class="btn btn-default delete-all" data-dismiss="modal">Clear All</button>
 public function run()
 {
     $notifications = Notification::getNotifications(false);
     return $this->render('menu', ['notifications' => $notifications]);
 }
Beispiel #4
0
                    <?php 
    foreach ($notifications->models as $model) {
        ?>
                        <?php 
        /** @var $model Notification */
        ?>
                        <li  class="notification <?php 
        echo $model->isRead() ? '' : 'not_read';
        ?>
" data-id="<?php 
        echo $model->id;
        ?>
">
                            <a href="#">
                                <i class="<?php 
        echo Notification::getTypeCss($model->type);
        ?>
"></i> <?php 
        echo $model->message;
        ?>
                            </a>
                        </li>
                    <?php 
    }
    ?>
                </ul>
                <?php 
}
?>
            </li>
            <li class="footer"><a href="#" data-toggle="modal" data-target="#all-notification" class="view-all">View all</a></li>