コード例 #1
0
ファイル: UrlGenerator.php プロジェクト: bobbiebenton/herbie
 /**
  * Generates a relative URL based on the given route.
  * @param string $route The URL route. This should be in the format of 'route/to/a/page'.
  * @return string The generated relative URL.
  */
 public function generate($route)
 {
     $route = ltrim($route, '/');
     if ($this->niceUrls) {
         $url = $this->request->getBasePath() . '/' . $route;
     } else {
         $url = $this->request->getScriptName() . '/' . $route;
     }
     return $this->filterUrl($url);
 }