views_plugin_display_default.inc

  1. 3.x plugins/views_plugin_display_default.inc
  2. 2.x plugins/views_plugin_display_default.inc

Contains the default display plugin.

File

plugins/views_plugin_display_default.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Contains the default display plugin.
  5. */
  6. /**
  7. * A plugin to handle defaults on a view.
  8. *
  9. * @ingroup views_display_plugins
  10. */
  11. class views_plugin_display_default extends views_plugin_display {
  12. /**
  13. * Determine if this display is the 'default' display which contains
  14. * fallback settings
  15. */
  16. function is_default_display() { return TRUE; }
  17. /**
  18. * The default execute handler fully renders the view.
  19. *
  20. * For the simplest use:
  21. * @code
  22. * $output = $view->execute_display('default', $args);
  23. * @endcode
  24. *
  25. * For more complex usages, a view can be partially built:
  26. * @code
  27. * $view->set_arguments($args);
  28. * $view->build('default'); // Build the query
  29. * $view->execute(); // Run the query
  30. * $output = $view->render(); // Render the view
  31. * @endcode
  32. *
  33. * If short circuited at any point, look in $view->build_info for
  34. * information about the query. After execute, look in $view->result
  35. * for the array of objects returned from db_query.
  36. *
  37. * You can also do:
  38. * @code
  39. * $view->set_arguments($args);
  40. * $output = $view->render('default'); // Render the view
  41. * @endcode
  42. *
  43. * This illustrates that render is smart enough to call build and execute
  44. * if these items have not already been accomplished.
  45. *
  46. * Note that execute also must accomplish other tasks, such
  47. * as setting page titles, breadcrumbs, and generating exposed filter
  48. * data if necessary.
  49. */
  50. function execute() {
  51. return $this->view->render($this->display->id);
  52. }
  53. }