本文整理汇总了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;
}
}