本文整理匯總了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]);
}
示例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);
}
示例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;
}
}