views_get_view

Versions
5
views_get_view($view_name)
6 – 7
views_get_view($name, $reset = FALSE)

This function loads a view by name or vid; if not found in db, it looks for a default view by that name.

▾ 21 functions call views_get_view()

calendar_ical_setup_form in contributions/calendar/calendar_ical.module
Setup Calendar feeds.
date_embed_view in contributions/date/date_api.module
Embed a view using a PHP snippet.
devel_load_object in contributions/devel/devel.module
Menu callback; prints the loaded structure of the current node/user.
devel_views_object in contributions/devel/devel.module
og_view_group in contributions/og/og.module
theme_view in contributions/views/views.module
Returns a themed view.
views_carousel_ahah in contributions/carousel/views_carousel/views_carousel.module
Load carousel items.
views_fastsearch_form_alter in contributions/views_fastsearch/views_fastsearch.module
Implement hook_form_alter.
views_menu_admin_items in contributions/views/views.module
Add the adminstrative items to a view.
views_menu_inline_items in contributions/views/views.module
views_patterns in contributions/patterns/components/views.inc
views_service_export_view in contributions/services/services/views_service/views_service.module
Export a view.
views_service_get_view in contributions/services/services/views_service/views_service.module
Get a view from the database.
views_service_import_view in contributions/services/services/views_service/views_service.module
Import a view.
views_theme_wizard_form in contributions/views/views_theme_wizard.module
views_update_12 in contributions/views/views.install
views_view_block in contributions/views/views.module
This views a view by block. Can be used as a callback or programmatically.
views_view_page in contributions/views/views.module
This views a view by page, and should only be used as a callback.
_calendar_info in contributions/calendar/calendar_admin.inc
Function to get information about all views that have calendar components.
_nodereference_item in contributions/cck/nodereference.module
_nodereference_potential_references in contributions/cck/nodereference.module
Fetch an array of all candidate referenced nodes, for use in presenting the selection form to the user.

Code

contributions/views/views.module, line 370

<?php
function views_get_view($view_name) {
  views_load_cache();
  $view = _views_load_view($view_name);
  if ($view) {
    return $view;
  }

  if (is_int($view_name)) {
    return; // don't bother looking if view_name is an int!
  }

  $default_views = _views_get_default_views();

  if (isset($default_views[$view_name])) {
    $view = $default_views[$view_name];
    $view->is_cacheable = _views_is_cacheable($view);
    return $view;
  }
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.