Nette\Http\Url::setHost PHP Метод

setHost() публичный Метод

Sets the host part of URI.
public setHost ( $value ) : self
Результат self
    public function setHost($value)
    {
        $this->host = (string) $value;
        $this->setPath($this->path);
        return $this;
    }

Usage Example

Пример #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::setHost