1.20.x 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
- modules/
views/ views.module, line 1301 - 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;
}