function views_set_current_view

Set the current 'current view' that is being built/rendered so that it is easy for other modules or items in drupal_eval to identify

Return value

Drupal\views\ViewExecutable

3 calls to views_set_current_view()
ViewExecutable::postExecute in drupal/core/modules/views/lib/Drupal/views/ViewExecutable.php
Unset the current view, mostly.
ViewExecutable::preExecute in drupal/core/modules/views/lib/Drupal/views/ViewExecutable.php
Run attachments and let the display do what it needs to do prior to running.
views_get_current_view in drupal/core/modules/views/views.module
Find out what, if any, current view is currently in use.

File

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

Code

function &views_set_current_view($view = NULL) {
  static $cache = NULL;
  if (isset($view)) {
    $cache = $view;
  }
  return $cache;
}