setQueryParameter() public method

public setQueryParameter ( $name, $value ) : self
return self
Ejemplo n.º 1
0
 /**
  * @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;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 /**
  * 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;
 }
Ejemplo n.º 4
0
 /**
  * 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;
 }
Ejemplo n.º 5
0
 /**
  * @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;
 }
Ejemplo n.º 6
0
 /**
  * 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}";
     }
 }