class Dropbutton

Pre-render callback for the "dropbutton" element type.

@BootstrapPrerender("dropbutton", replace = "Drupal\Core\Render\Element\Dropbutton::preRenderDropbutton" )

Hierarchy

Expanded class hierarchy of Dropbutton

See Also

  • \Drupal\Core\Render\Element\Dropbutton::preRenderDropbutton()

Related topics

Namespace

Drupal\bootstrap\Plugin\Prerender
Source
class Dropbutton extends PrerenderBase {

  /**
   * {@inheritdoc}
   */
  public static function preRenderElement(Element $element) {
    $element['#attached']['library'][] = 'bootstrap/dropdown';

    // Enable targeted theming of specific dropbuttons (e.g., 'operations' or
    // 'operations__node').
    if ($subtype = $element->getProperty('subtype')) {
      $element->setProperty('theme', $element->getProperty('theme') . "__$subtype");
    }
  }

}

Members

Contains filters are case sensitive
Name Modifiers Type Description
Dropbutton::preRenderElement public static function Pre-render element callback. Overrides PrerenderBase::preRenderElement
PrerenderBase::preRender public static function Pre-render render array element callback. Overrides PrerenderInterface::preRender