当前位置: 首页>>代码示例>>PHP>>正文


PHP Notification::notifications方法代码示例

本文整理汇总了PHP中Notification::notifications方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::notifications方法的具体用法?PHP Notification::notifications怎么用?PHP Notification::notifications使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notification的用法示例。


在下文中一共展示了Notification::notifications方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Notification

					<ul>
						<li class="selected-option"><a href="./">Recent Activity</a></li>
						<li><a href="friend-requests.php">Friend Requests</a></li>
						<li><a href="my-friends.php">Friends</a></li>
						<li><a href="search.php">Search</a></li>
					</ul>
				</div>
				<div id="main-container" class="page">
					<h2 class="title">Recent Activity</h2>
					<?php 
    include 'includes/alerts.php';
    ?>
					<?php 
    $activity = new Notification();
    if ($activity->get($user->data()->id)) {
        $notifications = $activity->notifications();
        ?>
						<?php 
        foreach ($notifications as $notification) {
            ?>
							<div class="notification">
								<div class="picture">
									<a href="profile.php?user=<?php 
            echo $notification['username'];
            ?>
"><img src="<?php 
            echo $notification['profilePicture'];
            ?>
"></a>
								</div>
								<div class="message">
开发者ID:shh4,项目名称:social-network,代码行数:31,代码来源:index.php

示例2: init

 /**
  * Initializes the Notification service.
  *
  *  <code>
  *      Notification::init();
  *  </code>
  *
  * This will read notification/flash data from the $_SESSION variable and load it into
  * the $this->previous array.
  */
 public static function init()
 {
     // Get notification/flash data...
     if (!empty($_SESSION[Notification::SESSION_KEY]) && is_array($_SESSION[Notification::SESSION_KEY])) {
         Notification::$notifications = $_SESSION[Notification::SESSION_KEY];
     }
     $_SESSION[Notification::SESSION_KEY] = array();
 }
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:18,代码来源:Notification.php

示例3: _unserialize

 /**
  * This function restores saved notifications.  It also handles whether or
  * not to clear not persisting notifications.
  *
  * @return array
  */
 public static function _unserialize()
 {
     if (!isset(self::$notifications)) {
         if (isset($_SESSION["Notifications"])) {
             self::$notifications = $_SESSION["Notifications"];
             foreach (self::$notifications as $notification) {
                 switch ($notification->persist) {
                     case 0:
                         unset(self::$notifications[$notification->id]);
                         break;
                     case 1:
                         $notification->persist = 0;
                         break;
                 }
                 if ($notification->id >= self::$next_id) {
                     self::$next_id = $notification->id + 1;
                 }
             }
         } else {
             self::$notifications = array();
         }
     }
     $_SESSION["Notifications"] = self::$notifications;
     return self::$notifications;
 }
开发者ID:byronwall,项目名称:runnDAILY,代码行数:31,代码来源:notification.php


注:本文中的Notification::notifications方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。