本文整理匯總了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'));
}