symfony: get current absolute URL

sfContext::getInstance()->getController()->genUrl('@my_route_name', true),

 

url_for() trace

  • UrlHelper url_for()
  • UrlHelper url_for1()
    • return sfContext::getInstance()->getController()->genUrl($internal_uri, $absolute);
  • sfWebController::genUrl($parameters = array(), $absolute = false)
    • $this->context->getRouting()->generate($route, $parameters, $absolute);
    • For ullright getRouting() is class ullRouting -> sfPatternRouting -> sfRouting
  • sfPatternRouting::generate($name, $params = array(), $absolute = false)
    • $url = $route->generate($params, $this->options['context'], $absolute);
      • $route instance of sfRoute
      • sfRoute::generate($params, $context = array(), $absolute = false)
    • return $this->fixGeneratedUrl($url, $absolute);