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
- class \Drupal\bootstrap\Plugin\Prerender\PrerenderBase implements PrerenderInterface
- class \Drupal\bootstrap\Plugin\Prerender\Dropbutton
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\PrerenderView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Dropbutton:: |
public static | function |
Pre-render element callback. Overrides PrerenderBase:: |
|
PrerenderBase:: |
public static | function |
Pre-render render array element callback. Overrides PrerenderInterface:: |