Page callback: Displays a page view, given a name and display id.
$name: The name of a view.
$display_id: The display id of a view.
Either the HTML of a fully-executed view, or MENU_NOT_FOUND.
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)) {
if ($output = $view
->executeDisplay($display_id, $args)) {
return $output;
}
else {
return array();
}
}
// Fallback if we get here no view was found.
return MENU_NOT_FOUND;
}