本文整理汇总了PHP中UserPeer::getByUsername方法的典型用法代码示例。如果您正苦于以下问题:PHP UserPeer::getByUsername方法的具体用法?PHP UserPeer::getByUsername怎么用?PHP UserPeer::getByUsername使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserPeer
的用法示例。
在下文中一共展示了UserPeer::getByUsername方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleErrorEdit
public function handleErrorEdit()
{
$user = UserPeer::getByUsername($this->getRequestParameter('username'));
// make sure it's a valid user, and that we're editing our own profile
if (!$user instanceof User) {
$this->error = 'No such user exists.';
$this->setTemplate('_error');
return sfView::SUCCESS;
} else {
if (!$this->getUser()->getRaykuUser()->equals($user)) {
$this->error = 'You do not have permission to edit this user\'s profile.';
$this->setTemplate('_error');
return sfView::SUCCESS;
}
}
// passing to view
$this->user = $user;
return sfView::SUCCESS;
}
示例2: link_to
?>
<?php
echo link_to($message->getSender()->getName(), '@profile?username=' . $message->getSender()->getUsername(), array('class' => 'usrname'));
?>
<br/><br/>
<p class="awrds" style="line-height:16px">NOTE: *The contents of this message is confidential and should<br />
not be duplicated without the expressed permission of sender*</p>
</div>
<div class="spacer" style="border-top:1px solid #DDD;margin-bottom:15px;"></div>
<div class="title">Message:</div>
<div class="spacer"></div>
<div class="msg">
<?php
$kinkarsoUser = UserPeer::getByUsername(RaykuCommon::SITE_USER_USERNAME);
if ($kinkarsoUser && $kinkarsoUser->getId() == $message->getSenderId()) {
echo $message->getBody();
} else {
echo $message->getBody();
}
?>
</div>
</div>
<div class="spacer"></div>
<div class="bottom"></div>
</div>
<div style="float:right;"> <a href="/message/compose/<?php
echo $message->getSender()->getUsername();
?>
/subject/Re: <?php