function views_page
3.x views.module | views_page( |
2.x views.module | views_page() |
Page callback: Displays a page view, given a name and display id.
Parameters
$name: The name of a view.
$display_id: The display id of a view.
Return value
Either the HTML of a fully-executed view, or MENU_NOT_FOUND.
1 string reference to 'views_page'
- views_plugin_display_page::execute_hook_menu in plugins/
views_plugin_display_page.inc - Add this display's path information to Drupal's menu system.
File
- ./
views.module, line 517 - Primarily Drupal hooks and global API functions to manipulate views.
Code
function views_page($name, $display_id) {
$args = func_get_args();
// Remove $name and $display_id from the arguments.
array_shift($args);
array_shift($args);
// Load the view and render it.
if ($view = views_get_view($name)) {
return $view->execute_display($display_id, $args);
}
// Fallback; if we get here no view was found or handler was not valid.
return MENU_NOT_FOUND;
}