W3cubDocs

/Drupal 8

function hook_views_ui_display_top_links_alter

hook_views_ui_display_top_links_alter(array &$links, ViewExecutable $view, $display_id)

Alter the links displayed at the top of the view edit form.

Parameters

array $links: A renderable array of links which will be displayed at the top of the view edit form. Each entry will be in a form suitable for '#theme' => 'links'.

\Drupal\views\ViewExecutable $view: The view object being edited.

string $display_id: The ID of the display being edited, e.g. 'default' or 'page_1'.

See also

\Drupal\views_ui\ViewUI::renderDisplayTop()

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

core/modules/views/views.api.php, line 938
Describes hooks and plugins provided by the Views module.

Code

function hook_views_ui_display_top_links_alter(array &$links, ViewExecutable $view, $display_id) {
  // Put the export link first in the list.
  if (isset($links['export'])) {
    $links = array('export' => $links['export']) + $links;
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!views!views.api.php/function/hook_views_ui_display_top_links_alter/8.1.x