You are here

class Dropbutton in Express 8

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

Plugin annotation


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

Hierarchy

Expanded class hierarchy of Dropbutton

See also

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

File

themes/contrib/bootstrap/src/Plugin/Prerender/Dropbutton.php, line 23
Contains \Drupal\bootstrap\Plugin\Prerender\Dropbutton.

Namespace

Drupal\bootstrap\Plugin\Prerender
View 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

Namesort descending Modifiers Type Description Overrides
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