本文整理匯總了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();