Nette\Http\Url::appendQuery PHP Method

appendQuery() public method

Appends the query part of URI.
public appendQuery ( $value ) : self
return self
    public function appendQuery($value)
    {
        $this->query = is_array($value) ? $value + $this->query : self::parseQuery($this->getQuery() . '&' . $value);
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 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
 }
All Usage Examples Of Nette\Http\Url::appendQuery