當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Confide::User方法代碼示例

本文整理匯總了PHP中Confide::User方法的典型用法代碼示例。如果您正苦於以下問題:PHP Confide::User方法的具體用法?PHP Confide::User怎麽用?PHP Confide::User使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Confide的用法示例。


在下文中一共展示了Confide::User方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: home

 /**
  * @return $this
  */
 public function home()
 {
     if (Confide::User()) {
         $this->dsp->content = Confide::user()->getContent();
     }
     return View::make('dispatch')->with(['dsp' => $this->dsp]);
 }
開發者ID:birdiebel,項目名稱:G2016,代碼行數:10,代碼來源:HomeController.php

示例2: __construct

 public function __construct()
 {
     // Fetch the User object, or set it to false if not logged in
     if (Confide::User()) {
         $this->logged_in_user = Confide::User();
     } else {
         $this->logged_in_user = false;
     }
     View::share('logged_in_user', $this->logged_in_user);
     View::share('success_message', $this->success_message);
 }
開發者ID:viniciusferreira,項目名稱:laravel-skeleton,代碼行數:11,代碼來源:AdminController.php

示例3: getEmail

 /**
  * Retrieving the email of current logged-in user . 
  * The "authAdapter" directive into config.php defines which Authentication
  *  adapter is use in current app .
  * Currently , this package supports three adapters (Auth , Sentry and Confide)
  * As a fallback measure , a third option can be used while calling the Class
  * Gravatar::get( null , false , 'johnemail@gmail.com')
  * @return void
  * 
  */
 protected function getEmail()
 {
     $authAdapter = Config::get('laravel4-getgravatar::authAdapter');
     switch (strtolower($authAdapter)) {
         case 'sentry':
             if (Sentry::check()) {
                 $this->email = Sentry::getUser()->email;
             }
             break;
         case 'confide':
             if (Confide::user()) {
                 $this->email = Confide::User()->email;
             }
             break;
         case 'auth':
             if (Auth::check()) {
                 $this->email = Auth::User()->email;
             }
             break;
         default:
             $this->email = null;
     }
 }
開發者ID:ascension,項目名稱:laravel4-getgravatar,代碼行數:33,代碼來源:Getgravatar.php


注:本文中的Confide::User方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。