本文整理匯總了PHP中Invitation::generateInvCode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Invitation::generateInvCode方法的具體用法?PHP Invitation::generateInvCode怎麽用?PHP Invitation::generateInvCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Invitation
的用法示例。
在下文中一共展示了Invitation::generateInvCode方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
/**
* Shows the page to the user.
* @param string $sub: The subpage string argument (if any).
* [[Special:HelloWorld/subpage]].
*/
public function execute($sub)
{
$out = $this->getOutput();
$request = $this->getRequest();
$user = $this->getUser();
// Set the page title, robot policies, etc.
$this->setHeaders();
// If the user doesn't have the required 'SendToFollowers' permission, display an error
if (!$user->isAllowed('getinvitationcode')) {
$out->permissionRequired('getinvitationcode');
return;
}
$out->setPageTitle($this->msg('huijimiddleware-invitationcode'));
// Is the database locked?
if (wfReadOnly()) {
$out->readOnlyPage();
return false;
}
// Blocked through Special:Block? No access for you!
if ($user->isBlocked()) {
$out->blockedPage(false);
return false;
}
// Parses message from .i18n.php as wikitext and adds it to the
// page output.
$num = $request->getVal('num');
if ($num == '') {
$num = 1;
}
Invitation::generateInvCode($num);
$code = Invitation::getInvList($num);
$out->addHtml($code);
// $out->addWikiMsg( 'huijimiddleware-helloworld-intro' );
}