3 namespace Drupal\views\Plugin\views\display_extender;
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\views\Plugin\views\PluginBase;
9 * @defgroup views_display_extender_plugins Views display extender plugins
11 * Plugins that offer additional display options across display types.
13 * Display extender plugins allow additional options or configuration to be
14 * added to views across all display types. For example, if you wanted to allow
15 * site users to add certain metadata to the rendered output of every view
16 * display regardless of display type, you could provide this option as a
19 * Display extender plugins extend
20 * \Drupal\views\Plugin\views\display_extender\DisplayExtenderPluginBase.
21 * They must be annotated with
22 * \Drupal\views\Annotation\ViewsDisplayExtender annotation, and they
23 * must be in namespace directory Plugin\views\display_extender.
25 * @ingroup views_plugins
28 * @see views_display_plugins
32 * Base class for Views display extender plugins.
34 abstract class DisplayExtenderPluginBase extends PluginBase {
37 * Provide a form to edit options for this plugin.
39 public function defineOptionsAlter(&$options) {}
42 * Provide a form to edit options for this plugin.
44 public function buildOptionsForm(&$form, FormStateInterface $form_state) {}
47 * Validate the options form.
49 public function validateOptionsForm(&$form, FormStateInterface $form_state) {}
52 * Handle any special handling on the validate form.
54 public function submitOptionsForm(&$form, FormStateInterface $form_state) {}
57 * Set up any variables on the view prior to execution.
59 public function preExecute() {}
62 * Inject anything into the query that the display_extender handler needs.
64 public function query() {}
67 * Provide the default summary for options in the views UI.
69 * This output is returned as an array.
71 public function optionsSummary(&$categories, &$options) {}
74 * Static member function to list which sections are defaultable
75 * and what items each section contains.
77 public function defaultableSections(&$sections, $section = NULL) {}