You are here

function views_get_current_view in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/views.module \views_get_current_view()
  2. 9 core/modules/views/views.module \views_get_current_view()

Find out what, if any, current view is currently in use.

Note that this returns a reference, so be careful! You can unintentionally modify the $view object.

Return value

\Drupal\views\ViewExecutable The current view object.

File

core/modules/views/views.module, line 521
Primarily Drupal hooks and global API functions to manipulate views.

Code

function &views_get_current_view() {
  return views_set_current_view();
}