Nette\Http\Url::setPath PHP 메소드

setPath() 공개 메소드

Sets the path part of URI.
public setPath ( $value ) : self
리턴 self
    public function setPath($value)
    {
        $this->path = (string) $value;
        if ($this->host && substr($this->path, 0, 1) !== '/') {
            $this->path = '/' . $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::setPath