Dropbutton.php in Express 8
File
themes/contrib/bootstrap/src/Plugin/Prerender/Dropbutton.php
View source
<?php
namespace Drupal\bootstrap\Plugin\Prerender;
use Drupal\bootstrap\Annotation\BootstrapPrerender;
use Drupal\bootstrap\Utility\Element;
class Dropbutton extends PrerenderBase {
public static function preRenderElement(Element $element) {
$element['#attached']['library'][] = 'bootstrap/dropdown';
if ($subtype = $element
->getProperty('subtype')) {
$element
->setProperty('theme', $element
->getProperty('theme') . "__{$subtype}");
}
}
}
Classes
Name |
Description |
Dropbutton |
Pre-render callback for the "dropbutton" element type. |