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


PHP Notify::getNotify方法代码示例

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


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

示例1: actionUpdate

 public function actionUpdate()
 {
     header('Content-type: application/json');
     $count_new = Notify::getCountNew();
     $models = Notify::getNotify(null, null, $count_new);
     $count = Yii::app()->request->getParam('count');
     if ($count && $count == $count_new) {
         return;
     }
     $module = $this->getModule();
     $content = $this->renderPartial('_content', ['model' => $models, 'count_new' => $count_new, 'assetsPath' => $module->publishedUrl, 'timeUpdateCenter' => $module->timeUpdateCenter], true);
     echo json_encode(['count' => $count_new, 'content' => $content]);
     Yii::app()->end();
 }
开发者ID:bookin,项目名称:yii-notification-center,代码行数:14,代码来源:NotifyController.php

示例2: run

 public function run()
 {
     $model = [];
     $count_new = 0;
     if (!Yii::app()->user->isGuest) {
         $count_new = Notify::getCountNew();
         $model = Notify::getNotify(null, null, $count_new);
     } elseif (Yii::app()->notify->isShowForGuest) {
         //unset(Yii::app()->notify->guestSession);
         $session = Yii::app()->notify->guestSession;
         if (!isset($session['id'])) {
             $session = ['id' => 'guest_' . rand()];
             Yii::app()->notify->guestSession = $session;
         }
         $count_new = 1;
         /*if(empty($session['status']))
               $count_new = 1;
           else
               $count_new = 0;*/
         $newModel = new Notify();
         $newModel->id = $session['id'];
         //            $newModel->header = 'Hello, welcome back!';
         $newModel->description = Yii::app()->notify->messageForGuest;
         //            $newModel->date_show = date("Y-m-d H:i:s");
         $newModel->setUrl(['/site/login']);
         $newModel->img = $newModel->getDefaultImage();
         $model = [$newModel];
     }
     if (Yii::app()->user->isGuest) {
         $isShowForGuest = Yii::app()->notify->isShowForGuest && empty(Yii::app()->notify->guestSession['status']) ? true : false;
         $isCheckNew = false;
     } else {
         $isShowForGuest = false;
         $isCheckNew = true;
     }
     $this->render('widget', array('model' => $model, 'count_new' => $count_new, 'assetsPath' => $this->module->publishedUrl, 'timeUpdateCenter' => Yii::app()->notify->timeUpdateCenter, 'notifyUrlUpdate' => $this->module->notifyUrlUpdate, 'isCheckNew' => $isCheckNew, 'isShowForGuest' => $isShowForGuest));
 }
开发者ID:bookin,项目名称:yii-notification-center,代码行数:37,代码来源:WidgetNotifyCenter.php

示例3: getNotifyByUserId

 /**
  * @param $user_id
  * @return static[]
  */
 public function getNotifyByUserId($user_id)
 {
     return Notify::getNotify(null, $user_id);
 }
开发者ID:bookin,项目名称:yii-notification-center,代码行数:8,代码来源:NotifyComponent.php


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