本文整理汇总了PHP中common\models\User::getUsernameById方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getUsernameById方法的具体用法?PHP User::getUsernameById怎么用?PHP User::getUsernameById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common\models\User
的用法示例。
在下文中一共展示了User::getUsernameById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCommentByParId
public static function getCommentByParId($parId)
{
$comment = static::findOne($parId);
if ($comment) {
return User::getUsernameById($comment->userId);
}
}
示例2:
<a href="/member/ruzuojun"><img class="media-object" src="/uploads/avatars/cache/50_1SB1v6BlGNsO4b-1UnVyE2l3LzscfkLJ.jpg" alt=""></a>
</div>
<div class="infos">
<div class="media-heading">
<?php
echo html::a($v['title'], ['/main/view', 'id' => $v['id']], ['title' => $v['title']]);
?>
<i class="fa fa-trophy excellent"></i>
</div>
<div class="media-body meta title-info">
<a class="remove-padding-left" href="/topic/221"><span class="fa fa-thumbs-o-up"><?php
echo $i++;
?>
</span></a>
<?php
echo Html::a(User::getUsernameById($v['userId']), ['/user/show', 'id' => $v['userId']]), '•', Html::tag('span', Yii::$app->formatter->asRelativeTime($v['createTime']));
?>
</div>
</div>
</li>
<?php
}
}
?>
</div>
<?php
// 显示分页
echo LinkPager::widget(['pagination' => $pages]);
?>
</div>
</div>
示例3:
<?php
use yii\helpers\Html;
use common\models\User;
?>
<div class="panel panel-default">
<div class="panel-heading media clearfix">
<div class="media-body">
<h1 class="media-heading"><?php
echo $model['title'];
?>
</h1>
<div class="info">
<?php
echo html::a($model['tags'], ['/tag/detail', 'tag' => $model['tags']], ['class' => 'node']) . '·' . html::a(User::getUsernameById($model['userId']), ['/user/index', 'id' => $model['userId']], ['class' => 'node']);
?>
· 于
<abbr title="2015-09-30 10:32:21"><?php
echo Html::tag('span', Yii::$app->formatter->asRelativeTime($model['createTime']));
?>
</abbr>
发布 · <?php
echo $model['scanNum'];
?>
次浏览
</div>
</div>
<div class="avatar media-right">
<a href="/index.php?r=user%2Findex&id=<?php
echo $model['userId'];