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


PHP WebRequest::getQueryValues方法代碼示例

本文整理匯總了PHP中WebRequest::getQueryValues方法的典型用法代碼示例。如果您正苦於以下問題:PHP WebRequest::getQueryValues方法的具體用法?PHP WebRequest::getQueryValues怎麽用?PHP WebRequest::getQueryValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WebRequest的用法示例。


在下文中一共展示了WebRequest::getQueryValues方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

	public function execute( $subPage ) {
		if ( session_id() == '' ) {
			wfSetupSession();
		}

		$this->load();

		// Check for [[Special:Userlogin/signup]]. This affects form display and
		// page title.
		if ( $subPage == 'signup' ) {
			$this->mType = 'signup';
		}
		$this->setHeaders();

		// If logging in and not on HTTPS, either redirect to it or offer a link.
		global $wgSecureLogin;
		if ( WebRequest::detectProtocol() !== 'https' ) {
			$title = $this->getFullTitle();
			$query = array(
				'returnto' => $this->mReturnTo,
				'returntoquery' => $this->mReturnToQuery,
				'title' => null,
			) + $this->mRequest->getQueryValues();
			$url = $title->getFullURL( $query, false, PROTO_HTTPS );
			if ( $wgSecureLogin && wfCanIPUseHTTPS( $this->getRequest()->getIP() ) ) {
				$url = wfAppendQuery( $url, 'fromhttp=1' );
				$this->getOutput()->redirect( $url );
				// Since we only do this redir to change proto, always vary
				$this->getOutput()->addVaryHeader( 'X-Forwarded-Proto' );
				return;
			} else {
				// A wiki without HTTPS login support should set $wgServer to
				// http://somehost, in which case the secure URL generated
				// above won't actually start with https://
				if ( substr( $url, 0, 8 ) === 'https://' ) {
					$this->mSecureLoginUrl = $url;
				}
			}
		}

		if ( !is_null( $this->mCookieCheck ) ) {
			$this->onCookieRedirectCheck( $this->mCookieCheck );
			return;
		} elseif ( $this->mPosted ) {
			if ( $this->mCreateaccount ) {
				$this->addNewAccount();
				return;
			} elseif ( $this->mCreateaccountMail ) {
				$this->addNewAccountMailPassword();
				return;
			} elseif ( ( 'submitlogin' == $this->mAction ) || $this->mLoginattempt ) {
				$this->processLogin();
				return;
			}
		}
		$this->mainLoginForm( '' );
	}
開發者ID:nahoj,項目名稱:mediawiki_ynh,代碼行數:57,代碼來源:SpecialUserlogin.php

示例2: desktopFooter

 /**
  * Appends a mobile view link to the desktop footer
  * @param Skin $sk
  * @param QuickTemplate $tpl
  * @param MobileContext $ctx
  * @param Title $title
  * @param WebRequest $req
  */
 public static function desktopFooter($sk, $tpl, $ctx, $title, $req)
 {
     $footerlinks = $tpl->data['footerlinks'];
     $args = $req->getQueryValues();
     // avoid title being set twice
     unset($args['title'], $args['useformat']);
     $args['mobileaction'] = 'toggle_view_mobile';
     $mobileViewUrl = $title->getFullURL($args);
     $mobileViewUrl = $ctx->getMobileUrl($mobileViewUrl);
     $link = Html::element('a', array('href' => $mobileViewUrl, 'class' => 'noprint stopMobileRedirectToggle'), wfMessage('mobile-frontend-view')->text());
     $tpl->set('mobileview', $link);
     $footerlinks['places'][] = 'mobileview';
     $tpl->set('footerlinks', $footerlinks);
 }
開發者ID:micha6554,項目名稱:mediawiki-extensions-MobileFrontend,代碼行數:22,代碼來源:MobileFrontend.skin.hooks.php


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