Example #1
0
 /**
  * Returns the baseurl with the optional
  * part, which will be appended
  *
  * @param  string $id
  * @param  array $arguments
  * @return string
  */
 public function routeUrl($id, $arguments = array())
 {
     return UrlHelper::getRouteUrl($id, $arguments);
 }
Example #2
0
 /**
  * @param  array $parts
  * @return string
  */
 private function parseUrl($parts)
 {
     $urlParts = Router::getInstance()->getRouteUrlParts();
     for ($i = 0, $len = count($parts); $i < $len; $i++) {
         $parts[$parts[$i]->getName()] = (string) $parts[$i];
         unset($parts[$i]);
     }
     return UrlHelper::getBaseUrl(implode('/', array_merge($urlParts, $parts)));
 }
Example #3
0
 /**
  * Returns the base url
  *
  * @param  string|array $parts
  * @return string
  */
 public function getBaseUrl($parts = "")
 {
     return UrlHelper::getBaseUrl($parts);
 }
Example #4
0
 /**
  * Sets the parent route and automatically
  * updates the url so it will be combined
  * recusively with the ones in the parent
  * routes
  *
  * @param Route $route
  * @return self
  */
 public function setParent(Route &$route)
 {
     $this->parent = $route;
     $current = $this->parent;
     $fromTmp = array();
     while (!is_null($current)) {
         $fromTmp[] = $current->getFrom();
         $current = $current->getParent();
     }
     $fromTmp = array_reverse($fromTmp);
     $fromTmp = implode('/', $fromTmp);
     $fromTmp = UrlHelper::cleanUrl($fromTmp);
     $this->fullFrom = UrlHelper::cleanUrl($fromTmp . $this->fullFrom);
     return $this;
 }
Example #5
0
 /**
  * Returns the base url
  *
  * @param  string $value
  * @return string
  */
 public static function execURL($value)
 {
     return UrlHelper::getBaseUrl($value);
 }