Views overview

Same name in other branches
  1. 9 core/modules/views/views.api.php \views_overview
  2. 8.9.x core/modules/views/views.api.php \views_overview
  3. 10 core/modules/views/views.api.php \views_overview

Overview of the Views module API

The Views module is a generalized query and display engine, which can be used to make views (formatted lists, grids, feeds, and other output) of items (often entities, but can be other types of data). Developers can interact with Views in several ways:

  • Provide plugins: Views plugins govern nearly every aspect of views, including querying (sorting, filtering, etc.) and display (at several levels of granularity, ranging from the entire view to the details of a field). See the Views plugins topic for more information.
  • Provide data: Data types can be provided to Views by implementing hook_views_data(), and data types provided by other modules can be altered by implementing hook_views_data_alter(). To provide views data for an entity, create a class implementing \Drupal\views\EntityViewsDataInterface and reference this in the "views_data" annotation in the entity class. You can autogenerate big parts of the integration if you extend the \Drupal\views\EntityViewsData base class. See the Entity API topic for more information about entities.
  • Implement hooks: A few operations in Views can be influenced by hooks. See the Views hooks topic for a list.
  • Theming: See the Views templates topic for more information.

See also

\Drupal\views\ViewExecutable

\Drupal\views\Views

File

core/modules/views/views.api.php, line 18

Sub-Topics

Title Sort descending File name Summary
Views plugins core/modules/views/views.api.php Overview of views plugins
Views template files core/modules/views/views.theme.inc Describes various views templates & overriding options.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.