Example #1
0
 /**
  * Generates an absolute 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 absolute URL.
  */
 public function generateAbsolute($route)
 {
     $baseurl = $this->request->getScheme() . '://' . $this->request->getHttpHost();
     return $baseurl . $this->generate($route);
 }
Example #2
0
 /**
  * @return string
  */
 protected function getBlogPathInfo()
 {
     $request = new Request();
     $segments = explode('/', $request->getRoute());
     if (empty($segments)) {
         return '';
     }
     $blogRoute = trim($this->blogRoute, '/');
     if ($segments[0] == $blogRoute) {
         array_shift($segments);
     }
     return implode('/', $segments);
 }