當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。