本文整理汇总了PHP中Nette\Http\Url::setQueryParameter方法的典型用法代码示例。如果您正苦于以下问题:PHP Url::setQueryParameter方法的具体用法?PHP Url::setQueryParameter怎么用?PHP Url::setQueryParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Http\Url
的用法示例。
在下文中一共展示了Url::setQueryParameter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addTrackingParameters
/**
* @param Payment $payment
* @return Payment
*/
public static function addTrackingParameters(Payment $payment)
{
$resURL = $payment->getResURL();
$url = new Url($resURL);
$url->setQueryParameter('utm_nooverride', 1);
$payment->setResURL($url->getAbsoluteUrl());
return $payment;
}
示例2: addTrackingParameters
public static function addTrackingParameters(Payment $payment)
{
$redirectUrls = $payment->getRedirectUrls();
$url = new Url($redirectUrls->getReturnUrl());
$url->setQueryParameter('utm_nooverride', 1);
$redirectUrls->setReturnUrl($url->getAbsoluteUrl());
$payment->setRedirectUrls($redirectUrls);
return $payment;
}
示例3: min
/**
* Pro zadane URL vytvori URL na minimalizacni skript
* @param string $url
* @param int $width [optional]
* @param int $height [optional]
* @return string
*/
public function min($url, $width = NULL, $height = NULL, $topcut = FALSE)
{
$min = new Url($this->scriptUrl);
$min->setQueryParameter('file', $url);
if ($width) {
$min->setQueryParameter('w', $width);
}
if ($height) {
$min->setQueryParameter('h', $height);
}
if ($width && $height) {
$min->setQueryParameter('exact', TRUE);
if ($topcut) {
$min->setQueryParameter('topcut', TRUE);
}
}
$minUrl = "/" . $min->getRelativeUrl();
return $minUrl;
}
示例4: signRequest
/**
* Sign current request
*
* @param Signature\SignatureMethod $method
*
* @return $this
*/
public function signRequest(Signature\SignatureMethod $method)
{
$this->url->setQueryParameter('oauth_signature_method', $method->getName());
$signature = $method->buildSignature($this->getSignatureBaseString(), $this->consumer, $this->token);
$this->url->setQueryParameter('oauth_signature', $signature);
$parameters = $this->getParameters();
ksort($parameters, SORT_STRING);
$authHeader = NULL;
foreach ($parameters as $key => $value) {
if (in_array($key, $this->oauthHeader)) {
$authHeader .= ' ' . $key . '="' . OAuth\Utils\Url::urlEncodeRFC3986($value) . '",';
// Remove oauth from query parameter
$this->url->setQueryParameter($key, NULL);
}
}
if ($authHeader !== NULL) {
$this->headers['Authorization'] = 'OAuth ' . trim(rtrim($authHeader, ','));
}
return $this;
}
示例5: buildUrl
/**
* @param array $parameters
* @return string
*/
protected function buildUrl(array $parameters = [])
{
$url = new Url(self::VERIFICATION_URL);
foreach ($parameters as $name => $value) {
$url->setQueryParameter($name, $value);
}
return (string) $url;
}
示例6: setHashtagButton
/**
* Configure hashtag button
*
* @param string $hashtag
*/
public function setHashtagButton($hashtag = NULL)
{
$this->element->addClass('twitter-hashtag-button');
// Build URL
$url = new Url(self::TWITTER_TWEET_URL);
$url->setQueryParameter('button_hashtag', $hashtag);
$this->href = (string) $url;
if ($hashtag) {
$this->elementText = "Tweet #{$hashtag}";
}
}