Nette\Http\Url::getRelativeUrl PHP Méthode

getRelativeUrl() public méthode

Returns the relative-URI.
public getRelativeUrl ( ) : string
Résultat string
    public function getRelativeUrl()
    {
        return (string) substr($this->getAbsoluteUrl(), strlen($this->getBaseUrl()));
    }

Usage Example

 /**
  * 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;
 }
All Usage Examples Of Nette\Http\Url::getRelativeUrl