You are here

function views_get_url in Views (for Drupal 7) 5

Figure out what the URL of the view we're currently looking at is.

3 calls to views_get_url()
views_build_view in ./views.module
This builds the basic view.
views_post_view_make_url in modules/views_node.inc
helper function -- this function builds a URL for a given feed. It defaults to the built in feed selector, but the 3rd arg can be used to set it up for custom selectors too.
views_rss_views_feed_argument in ./views_rss.module
feed argument hook that will convert us to RSS or display an icon. the 4th argument isn't part of the hook, but we use it to differentiate when called as a hook or when called manually from views_rss_views_post_view

File

./views.module, line 709

Code

function views_get_url($view, $args) {
  $url = $view->url;
  if (!empty($url)) {
    $where = 1;
    foreach ($args as $arg) {

      // This odd construct prevents us from strposing once there is no
      // longer an $arg to replace.
      if ($where && ($where = strpos($url, '$arg'))) {
        $url = substr_replace($url, $arg, $where, 4);
      }
      else {
        $url .= "/{$arg}";
      }
    }
  }
  return $url;
}