You are here

function _views_navigation_build_url in Views navigation 7

Used when the view handler needs an already built url.

This is the case when it will be passed to parse_url() as in views_handler_field::render_as_link().

Parameters

int $etid: The entity ID.

object $view: The views object.

array $options: Link options.

Return value

string The generated HTML for the link.

4 calls to _views_navigation_build_url()
views_navigation_handler_field_node::render_link in views/views_navigation_handler_field_node.inc
Implements render_link().
views_navigation_handler_field_node_link::render_link in views/views_navigation_handler_field_node_link.inc
Implements render_link().
views_navigation_handler_field_node_path::render in views/views_navigation_handler_field_node_path.inc
Implements render().
_views_navigation_replace_href_in_html in ./views_navigation.inc
Helper function to replace the links in HTML.

File

./views_navigation.inc, line 334
Views navigation main include file.

Code

function _views_navigation_build_url($etid, $view, array $options = [
  'absolute' => TRUE,
]) {
  $options['query'] = _views_navigation_build_query($etid, $view, isset($options['query']) ? $options['query'] : []);
  $entity_type = _views_navigation_get_entity_type($view->query);
  $entities = entity_load($entity_type, [
    $etid,
  ]);
  $uri = entity_uri($entity_type, reset($entities));
  return url($uri['path'], array_merge($options, $uri['options']));
}