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


PHP Http::toString方法代碼示例

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


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

示例1: getUri

 /**
  * Return the URI for this header
  *
  * @return string
  */
 public function getUri()
 {
     if ($this->uri instanceof HttpUri) {
         return $this->uri->toString();
     }
     return $this->uri;
 }
開發者ID:robertodormepoco,項目名稱:zf2,代碼行數:12,代碼來源:AbstractLocation.php

示例2: setUri

 /**
  * @param string $uri
  *
  * @return ImageUri
  */
 public function setUri($uri)
 {
     $this->uri = new Http($uri);
     if (!$this->uri->isAbsolute()) {
         throw new \InvalidArgumentException('Invalid image URL: ' . $this->uri->toString());
     }
     return $this;
 }
開發者ID:danielcosta,項目名稱:sellercenter-sdk,代碼行數:13,代碼來源:ImageUri.php

示例3: buildUrl

 protected function buildUrl($url)
 {
     if (!$this->apiKey) {
         throw new MissingAPIKeyException('Missing the API key.  Please either call setApiKey(), set the API key as a dependency parameter, or create a Magium/Mail/GeneratorConfiguration.php file to set the API key');
     }
     $uri = new Http($url);
     $uri->setQuery(['key' => $this->apiKey]);
     return $uri->toString();
 }
開發者ID:magium,項目名稱:MagiumMail,代碼行數:9,代碼來源:Configuration.php

示例4: testGetPortDoesntModifyUrlHttps

 public function testGetPortDoesntModifyUrlHttps()
 {
     $origUri = 'https://www.example.com/foo';
     $uri = new HttpUri($origUri);
     $uri->getPort();
     $this->assertEquals($origUri, $uri->toString());
 }
開發者ID:benivaldo,項目名稱:zf2-na-pratica,代碼行數:7,代碼來源:HttpTest.php

示例5: testNormalizationRemovesPort

 /**
  * Test that normalizing an HTTP URL removes the port depending on scheme
  *
  * @param string $orig
  * @param string $expected
  * @dataProvider portNormalizationTestsProvider
  */
 public function testNormalizationRemovesPort($orig, $expected)
 {
     $uri = new HttpUri($orig);
     $uri->normalize();
     $this->assertEquals($expected, $uri->toString());
 }
開發者ID:ruflin,項目名稱:zf2,代碼行數:13,代碼來源:HttpTest.php

示例6: partiallyRequest

 /**
  * @param Http $httpUri
  * @param int $offset
  * @param int $limit
  * @return array
  */
 protected function partiallyRequest(Http $httpUri, $offset, $limit)
 {
     $query = $httpUri->getQueryAsArray();
     $query['start'] = $offset;
     $query['count'] = $limit;
     $httpUri->setQuery($query);
     $elements = $this->mapper->fetchAll($httpUri->toString());
     $entityName = $this->classMetadata->getName();
     $entities = array();
     foreach ($elements as $element) {
         $hydrator = new EntityHydrator($this->classMetadata);
         $entities[] = $hydrator->hydrate($element, new $entityName());
     }
     return $entities;
 }
開發者ID:spalax,項目名稱:zf2-client-moysklad,代碼行數:21,代碼來源:BasicEntityPersister.php


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