1 views.module views_get_all_views($reset = FALSE)

Return an array of all views as fully loaded $view objects.

Parameters

$reset: If TRUE, reset the static cache forcing views to be reloaded.

File

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

Code

function views_get_all_views($reset = FALSE) {
  $views = &backdrop_static(__FUNCTION__, array());
  if ($reset || empty($views)) {
    $configs = config_get_names_with_prefix('views.view.');
    foreach ($configs as $config_file) {
      $config = config($config_file);
      $name = str_replace('views.view.', '', $config_file);
      $views[$name] = new view($config->get());
    }
  }
  return $views;
}