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


PHP Url::appendQuery方法代碼示例

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


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

示例1: setupCallbackUrl

 protected function setupCallbackUrl()
 {
     //Create and setup callback URL
     $this->callback_url = new Url();
     $this->callback_url->setScheme('http');
     $this->callback_url->setHost('ws.audioscrobbler.com');
     $this->callback_url->setPath('/2.0/');
     //2.0 - API version
     $this->callback_url->appendQuery("api_key={$this->key}");
     if ($this->data_format == self::DATA_JSON) {
         $this->callback_url->appendQuery('format=json');
     }
     //JSON result
 }
開發者ID:sg3tester,項目名稱:songator,代碼行數:14,代碼來源:Lastfm.php

示例2: render

 public function render($rowData)
 {
     if ($this->_renderer) {
         return call_user_func($this->_renderer, $this);
     }
     // Direct URL
     if ($this->_url !== NULL) {
         // URL callback
         if (is_callable($this->_url)) {
             $url = call_user_func($this->_url, $rowData);
         } else {
             $url = new Nette\Http\Url($this->_url);
             foreach ($this->_table->getIdColumns() as $key) {
                 $url->appendQuery(array('record' . ucfirst($key) => isset($rowData->{$key}) ? $rowData->{$key} : NULL));
             }
         }
         $this->element->href((string) $url);
         // Standard action's URL
     } else {
         $this->element->href($this->_table->createActionLink($this->getName(), $rowData));
     }
     // Class
     if (($class = $this->getClass($rowData)) !== NULL) {
         $this->element->class .= " {$class}";
     }
     return (string) $this->element;
 }
開發者ID:vbuilder,項目名稱:framework,代碼行數:27,代碼來源:DataTableButton.php

示例3: exec

 /**
  * Calls remote API.
  *
  * @param string
  * @return mixed json-decoded result
  * @throws \NetteAddons\IOException
  */
 protected function exec($path)
 {
     try {
         $url = new Url($this->baseUrl . '/' . ltrim($path, '/'));
         if ($this->clientId && $this->clientSecret) {
             $url->appendQuery(array('client_id' => $this->clientId, 'client_secret' => $this->clientSecret));
         }
         $request = $this->requestFactory->create($url);
         $request->addHeader('Accept', "application/vnd.github.{$this->apiVersion}+json");
         return \Nette\Utils\Json::decode($request->execute());
     } catch (\NetteAddons\Utils\StreamException $e) {
         throw new \NetteAddons\IOException('Request execution failed.', NULL, $e);
     } catch (\Nette\Utils\JsonException $e) {
         throw new \NetteAddons\IOException('GitHub API returned invalid JSON.', NULL, $e);
     }
 }
開發者ID:newPOPE,項目名稱:web-addons.nette.org,代碼行數:23,代碼來源:Repository.php

示例4: oauthResponse

 /**
  * Send OAuth response
  * @param array|\Traversable $data
  * @param string|null $redirectUrl
  * @param int $code
  */
 public function oauthResponse($data, $redirectUrl = NULL, $code = 200)
 {
     if ($data instanceof \Traversable) {
         $data = iterator_to_array($data);
     }
     $data = (array) $data;
     // Redirect, if there is URL
     if ($redirectUrl !== NULL) {
         $url = new Url($redirectUrl);
         if ($this->getParameter('response_type') == 'token') {
             $url->setFragment(http_build_query($data));
         } else {
             $url->appendQuery($data);
         }
         $this->redirectUrl($url);
     }
     // else send JSON response
     foreach ($data as $key => $value) {
         $this->payload->{$key} = $value;
     }
     $this->getHttpResponse()->setCode($code);
     $this->sendResponse(new JsonResponse($this->payload));
 }
開發者ID:drahak,項目名稱:oauth2,代碼行數:29,代碼來源:OAuthPresenter.php

示例5: appendQuery

 public function appendQuery($value)
 {
     parent::appendQuery($value);
     $this->queryArray = array();
     \parse_str($this->getQuery(), $this->queryArray);
 }
開發者ID:kathynka,項目名稱:Foundation,代碼行數:6,代碼來源:Url.php


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