本文整理汇总了PHP中UserHelper::viewProfile方法的典型用法代码示例。如果您正苦于以下问题:PHP UserHelper::viewProfile方法的具体用法?PHP UserHelper::viewProfile怎么用?PHP UserHelper::viewProfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserHelper
的用法示例。
在下文中一共展示了UserHelper::viewProfile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
public function show($id, $active = 0)
{
try {
$this->profile = new Profile($id);
$this->editable = (UserHelper::getProfileId() == $this->profile->getId() or UserHelper::isEditor());
$this->is_owner = UserHelper::getProfileId() == $this->profile->getId();
$this->is_allowed = $this->editable || UserHelper::viewProfile($this->profile);
if (!$this->is_allowed) {
throw new fValidationException('not allowed');
}
$this->username = $this->profile->getLoginName();
$this->avatarfile = AVATAR_DIR . $this->username . '-avatar.jpg';
$this->active = $active;
$this->render('profile/show');
} catch (fNotFoundException $e) {
Slim::getInstance()->notFound();
}
}
示例2: foreach
<button type="submit" class="btn btn-danger btn-large">给下列用户群发邮件</button>
<br/>
<div class="progress progress-striped active" style="display:none">
<div class="bar" style="width: 0%;"></div>
</div>
</form>
<?php
}
if (isset($this->users)) {
foreach ($this->users as $profile) {
?>
<?php
$username = $profile->getLoginName();
$avatarfile = AVATAR_DIR . $username . '-mini.jpg';
$isAllowed = $this->editable || UserHelper::viewProfile($profile);
?>
<article class="a-feed" id="user-<?php
echo $profile->getId();
?>
">
<aside>
<figure>
<?php
if ($isAllowed) {
?>
<a href="<?php
echo SITE_BASE;
?>
/profile/<?php
echo $profile->getId();