當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Contest::getField方法代碼示例

本文整理匯總了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);
 }
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:13,代碼來源:SpecialContestSignup.php

示例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'))));
 }
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:15,代碼來源:SpecialContest.php

示例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);
     }
 }
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:19,代碼來源:SpecialMyContests.php

示例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'));
 }
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:12,代碼來源:SpecialContestWelcome.php


注:本文中的Contest::getField方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。