PageAttachments.php in Express 8
File
themes/contrib/bootstrap/src/Plugin/Alter/PageAttachments.php
View source
<?php
namespace Drupal\bootstrap\Plugin\Alter;
use Drupal\bootstrap\Annotation\BootstrapAlter;
use Drupal\bootstrap\Plugin\PluginBase;
class PageAttachments extends PluginBase implements AlterInterface {
public function alter(&$attachments, &$context1 = NULL, &$context2 = NULL) {
if ($this->theme
->livereloadUrl()) {
$attachments['#attached']['library'][] = 'bootstrap/livereload';
}
if ($this->theme
->getSetting('popover_enabled')) {
$attachments['#attached']['library'][] = 'bootstrap/popover';
}
if ($this->theme
->getSetting('tooltip_enabled')) {
$attachments['#attached']['library'][] = 'bootstrap/tooltip';
}
$attachments['#attached']['drupalSettings']['bootstrap'] = $this->theme
->drupalSettings();
}
}