本文整理汇总了PHP中AUTH::user方法的典型用法代码示例。如果您正苦于以下问题:PHP AUTH::user方法的具体用法?PHP AUTH::user怎么用?PHP AUTH::user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AUTH
的用法示例。
在下文中一共展示了AUTH::user方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: User
<?php
# archive.php
# 1. logic
AUTH::kickout('login');
$user = new User();
$user->load(AUTH::user());
$project = new Project();
$project->load(['slug' => Route::param('slug')]);
$projects = new Projects_Collection();
$projects->where(['deleted' => '1']);
$projects->where(['user_id' => AUTH::user_id()]);
$projects->get();
$tasks = new Tasks_Collection();
$tasks->where(['deleted' => '0']);
$tasks->where(['user_id' => AUTH::user_id()]);
$tasks->where(['project_id' => $project->id]);
$tasks->order_by('progress', 'ASC');
$tasks->get();
# 2. views
include VIEWS . 'header.php';
include VIEWS . 'archive.php';
include VIEWS . 'footer.php';
示例2: e
"><?php
echo e($status->user->getNameOrUsername());
?>
</a></h4>
<p><?php
echo e($status->body);
?>
</p>
<ul class="list-inline">
<!--Outputs the timestap it was created of the $status object creation time || WHAT IS diffForHumans?-->
<li><?php
echo e($status->created_at->diffForHumans());
?>
</li>
<?php
if ($status->user->id !== AUTH::user()->id) {
?>
<li><a href="<?php
echo e(route('status.like', ['statusId' => $status->id]));
?>
">Like</a></li>
<?php
}
?>
<li><?php
echo e($status->likes->count());
?>
<?php
echo e(str_plural('like', $status->likes->count()));
?>
</li>
示例3: User
<?php
# home.php
# 1. logic
AUTH::kickout('login');
AUTH::user();
$user = new User();
$projects = new Projects_Collection();
$projects->where(['deleted' => '0']);
$projects->where(['user_id' => AUTH::user_id()]);
$projects->get();
# 2. views
include VIEWS . 'header.php';
include VIEWS . 'main.php';
include VIEWS . 'footer.php';