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


PHP Uri::getQueryAsArray方法代碼示例

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


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

示例1: __construct

 /**
  * Constructor
  *
  * @param OAuth\Consumer $consumer
  * @param string $url
  * @param string $method
  * @param array $params
  */
 public function __construct($consumer, $url, $method, $params = array())
 {
     $this->_consumer = $consumer;
     $this->_method = $method;
     //normalize the uri: remove the query params
     //and store them alonside the oauth and user params
     $this->_uri = new \MediaCore\Uri($url);
     $this->_unencodedQueryParams = $this->_uri->getQueryAsArray(true);
     $this->_uri->setQuery('');
     $this->_params = $params;
 }
開發者ID:mediacore,項目名稱:mediacore-client-php,代碼行數:19,代碼來源:Request.php

示例2: constructRedirectUri

 protected function constructRedirectUri($uri = null, array $query = array())
 {
     $uri = new Uri($uri);
     if (!empty($query)) {
         $query = $uri->getQueryAsArray() + $query;
         $uri->setQuery($query);
     }
     return $uri;
 }
開發者ID:ivan-novakov,項目名稱:zf2-openid-connect-server-module,代碼行數:9,代碼來源:AbstractAuthorizeResponse.php

示例3: getUrl

 /**
  * Get Url
  *
  * @return string
  */
 public function getUrl()
 {
     if ($this->uri instanceof Uri) {
         $url = array('href' => $this->uri->toString());
         $query = $this->uri->getQueryAsArray();
         if (sizeof($query) > 0) {
             $url['query'] = $query;
         }
         return $url;
     }
     return;
 }
開發者ID:parrotcage,項目名稱:aves,代碼行數:17,代碼來源:Link.php

示例4: clearUri

 /**
  * Get clear uri.
  *
  * @static
  *
  * @param \Zend\Uri\Uri $uri
  *
  * @return boolean|\Zend\Uri\Uri False if uri is not auhorized
  */
 public static function clearUri(Uri $uri)
 {
     if ($uri->getScheme() !== 'http') {
         return false;
     }
     $query = $uri->getQueryAsArray();
     if (empty($query['v'])) {
         return false;
     }
     $uri->setQuery(array('v' => $query['v']));
     $uri->setHost('www.youtube.com');
     $uri->setPath('/watch');
     // clear
     $uri->setPort(0);
     $uri->setUserInfo('');
     $uri->setFragment('');
     return $uri;
 }
開發者ID:pokap,項目名稱:media,代碼行數:27,代碼來源:Youtube.php

示例5: getValueForPrice

 /**
  * @param $price
  * @return FilterValue|null
  * @throws UnparseableValueException
  */
 public function getValueForPrice($price)
 {
     $values = $this->getFilterValues();
     foreach ($values as $value) {
         $url = $value->getLink();
         $uri = new Uri($url);
         $parts = $uri->getQueryAsArray();
         if (isset($parts['price'])) {
             $priceParts = explode('-', $parts['price']);
             if (!$priceParts[0]) {
                 $priceParts[0] = -1;
             }
             if (!$priceParts[1]) {
                 $priceParts[1] = PHP_INT_MAX;
             }
             // term 0, price filters seem to use less than
             if ($price >= $priceParts[0] & $price < $priceParts[1]) {
                 return $value;
             }
         }
     }
     return null;
 }
開發者ID:brentwpeterson,項目名稱:MagiumMagento,代碼行數:28,代碼來源:PriceFilter.php

示例6: testGetQueryAsArrayReturnsCorrectArray

 /**
  * @group ZF-1480
  */
 public function testGetQueryAsArrayReturnsCorrectArray()
 {
     $url = new Uri('http://example.com/foo/?test=a&var[]=1&var[]=2&some[thing]=3');
     $this->assertEquals('test=a&var[]=1&var[]=2&some[thing]=3', $url->getQuery());
     $exp = array('test' => 'a', 'var' => array(1, 2), 'some' => array('thing' => 3));
     $this->assertEquals($exp, $url->getQueryAsArray());
 }
開發者ID:navassouza,項目名稱:zf2,代碼行數:10,代碼來源:UriTest.php

示例7: canonizeUrl

 /**
  * Canonize URL with params, set `appkey` if not specified yet
  *
  * @param string|Uri $uri
  * @param array $params
  *
  * @return Uri
  */
 protected function canonizeUrl($uri, array $params = array())
 {
     if (!$uri instanceof Uri) {
         $uri = new Uri($uri);
     }
     if (!isset($params['appkey'])) {
         $params['appkey'] = Pi::config('identifier');
     }
     $params = array_merge($uri->getQueryAsArray(), $params);
     $uri->setQuery($params);
     return $uri;
 }
開發者ID:Andyyang1981,項目名稱:pi,代碼行數:20,代碼來源:Remote.php

示例8: getQueryAsArray

 /**
  * Return the query string as an associative array of key => value pairs
  *
  * @return array
  */
 public function getQueryAsArray()
 {
     return $this->uri->getQueryAsArray();
 }
開發者ID:sunnyct,項目名稱:silexcmf-core,代碼行數:9,代碼來源:Uri.php


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