class Dropbutton

Same name in this branch
  1. 9 core/lib/Drupal/Core/Render/Element/Dropbutton.php \Drupal\Core\Render\Element\Dropbutton
Same name and namespace in other branches
  1. 11.x core/modules/views/src/Plugin/views/field/Dropbutton.php \Drupal\views\Plugin\views\field\Dropbutton
  2. 11.x core/lib/Drupal/Core/Render/Element/Dropbutton.php \Drupal\Core\Render\Element\Dropbutton

Provides a handler that renders links as dropbutton.

Plugin annotation

@ViewsField("dropbutton");

Hierarchy

Expanded class hierarchy of Dropbutton

Related topics

10 string references to 'Dropbutton'
claro_preprocess_views_ui_display_tab_bucket in core/themes/claro/claro.theme
Implements hook_preprocess_HOOK() for views_ui_display_tab_bucket.
Dropbutton::preRenderDropbutton in core/lib/Drupal/Core/Render/Element/Dropbutton.php
Pre-render callback: Attaches the dropbutton library and required markup.
FieldDropbuttonTest::testDropbuttonMarkupShouldNotLeakBetweenRows in core/modules/views/tests/src/Kernel/Handler/FieldDropbuttonTest.php
Tests that dropbutton markup doesn't leak between rows.
views.view.content.yml in core/modules/node/config/optional/views.view.content.yml
core/modules/node/config/optional/views.view.content.yml
views.view.test_content_ajax.yml in core/modules/views/tests/modules/views_test_config/test_views/views.view.test_content_ajax.yml
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_content_ajax.yml

... See full list

File

core/modules/views/src/Plugin/views/field/Dropbutton.php, line 14

Namespace

Drupal\views\Plugin\views\field
View source
class Dropbutton extends Links {
  
  /**
   * {@inheritdoc}
   */
  public function render(ResultRow $values) {
    $links = $this->getLinks();
    if (!empty($links)) {
      return [
        '#type' => 'dropbutton',
        '#links' => $links,
      ];
    }
    else {
      return '';
    }
  }

}

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