You are here

class Dropbutton in Drupal 10

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

Provides a handler that renders links as dropbutton.

Plugin annotation

@ViewsField("dropbutton");

Hierarchy

  • class \Drupal\views\Plugin\views\field\Links extends \Drupal\views\Plugin\views\field\FieldPluginBase
    • class \Drupal\views\Plugin\views\field\Dropbutton

Expanded class hierarchy of Dropbutton

2 string references to 'Dropbutton'
views.view.test_dropbutton.yml in core/modules/views/tests/modules/views_test_config/test_views/views.view.test_dropbutton.yml
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_dropbutton.yml
views_views_data in core/modules/views/views.views.inc
Implements hook_views_data().

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 '';
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Dropbutton::render public function
Links::buildOptionsForm public function
Links::defineOptions public function
Links::getLinks protected function Gets the list of links used by this field.
Links::query public function
Links::usesGroupBy public function