| 5 views.module | views_get_view( |
| 6 views.module | views_get_view($name, $reset = FALSE) |
| 7 views.module | views_get_view($name, $reset = FALSE) |
Get a view from the database or from default views.
This function is just a static wrapper around views::load(). This function isn't called 'views_load()' primarily because it might get a view from the default views which aren't technically loaded from the database.
$name: The name of the view.
$reset: If TRUE, reset this entry in the load cache.
view A reference to the $view object. Use $reset if you're sure you want a fresh one.
<?php
function views_get_view($name, $reset = FALSE) {
if ($reset) {
$cache = &drupal_static('ctools_export_load_object');
if (isset($cache['views_view'][$name])) {
unset($cache['views_view'][$name]);
}
}
ctools_include('export');
$view = ctools_export_crud_load('views_view', $name);
if ($view) {
$view->update();
return $view->clone_view();
}
}
?>