本文整理汇总了PHP中Contest::getField方法的典型用法代码示例。如果您正苦于以下问题:PHP Contest::getField方法的具体用法?PHP Contest::getField怎么用?PHP Contest::getField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contest
的用法示例。
在下文中一共展示了Contest::getField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onSuccess
/**
* Redirect the user to the contest page and add the "new" argument to the URL
* so they get a success message.
*
* @since 0.1
*
* @param Contest $contest
*/
protected function onSuccess(Contest $contest)
{
$url = SpecialPage::getTitleFor('MyContests', $contest->getField('name'))->getLocalURL('new');
$this->getOutput()->redirect($url);
}
示例2: showMailFunctionality
/**
*
*
* @since 0.1
*
* @param Contest $contest
*/
protected function showMailFunctionality(Contest $contest)
{
$out = $this->getOutput();
$out->addHTML(Html::element('h3', array(), wfMsg('contest-contest-reminder-mail')));
$out->addWikiMsg('contest-contest-reminder-page', $contest->getField('reminder_email'));
$out->addHTML(Html::element('button', array('id' => 'send-reminder', 'data-token' => $this->getUser()->editToken(), 'data-contest-id' => $contest->getId(), 'data-reminder-subject' => wfMsgExt('contest-email-reminder-title', 'parsemag', $contest->getDaysLeft())), wfMsg('contest-contest-send-reminder')));
$out->addHTML(Html::rawElement('div', array('id' => 'reminder-content', 'style' => 'display:none'), ContestUtils::getParsedArticleContent($contest->getField('reminder_email'))));
}
示例3: handleEnabledPage
/**
* Handle page request when the contest is enabled.
*
* @since 0.1
*
* @param Contest $contest
*/
protected function handleEnabledPage(Contest $contest)
{
// Check if the user is already a contestant in this contest.
// If he is, redirect to submission page, else show signup form.
$contestant = ContestContestant::s()->selectRow(null, array('contest_id' => $contest->getId(), 'user_id' => $this->getUser()->getId()));
if ($contestant === false) {
$this->getOutput()->redirect(SpecialPage::getTitleFor('ContestSignup', $contest->getField('name'))->getLocalURL());
} else {
$contestant->setContest($contest);
$this->showSubmissionPage($contestant);
}
}
示例4: showRules
/**
* Show the rules for this contest.
*
* @since 0.1
*
* @param Contest $contest
*/
protected function showRules(Contest $contest)
{
// TODO: we might want to have a pop-up with the content here, instead of a link to the page.
$this->getOutput()->addWikiMsgArray('contest-welcome-rules', $contest->getField('rules_page'));
}