本文整理汇总了PHP中wAvatar::getAvatarUrlPath方法的典型用法代码示例。如果您正苦于以下问题:PHP wAvatar::getAvatarUrlPath方法的具体用法?PHP wAvatar::getAvatarUrlPath怎么用?PHP wAvatar::getAvatarUrlPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wAvatar
的用法示例。
在下文中一共展示了wAvatar::getAvatarUrlPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
$user = $this->getUser();
// Blocked users cannot submit new comments, and neither can those users
// without the necessary privileges. Also prevent obvious cross-site request
// forgeries (CSRF)
$id = $this->getMain()->getVal('userid');
$name = $this->getMain()->getVal('username');
$size = $this->getMain()->getVal('size');
if ($id == '') {
if ($name != '') {
$id = User::idFromName($name);
} else {
$id = 0;
}
}
if ($size = '') {
$size = 'l';
}
$avatar = new wAvatar($id, $size);
$responseBody = array('state' => 200, 'message' => '', 'html' => $avatar->getAvatarHtml(), 'url' => $avatar->getAvatarUrlPath());
$result = $this->getResult();
$result->addValue($this->getModuleName(), 'res', $responseBody);
return true;
}
示例2: getResult
public function getResult()
{
global $wgUser;
$uid = $wgUser->getId();
$avatar = new wAvatar($uid, 'l');
return $avatar->getAvatarUrlPath();
}