PrerenderManager.php in Express 8
File
themes/contrib/bootstrap/src/Plugin/PrerenderManager.php
View source
<?php
namespace Drupal\bootstrap\Plugin;
use Drupal\bootstrap\Theme;
use Drupal\bootstrap\Utility\Element;
class PrerenderManager extends PluginManager {
public function __construct(Theme $theme) {
parent::__construct($theme, 'Plugin/Prerender', 'Drupal\\bootstrap\\Plugin\\Prerender\\PrerenderInterface', 'Drupal\\bootstrap\\Annotation\\BootstrapPrerender');
$this
->setCacheBackend(\Drupal::cache('discovery'), 'theme:' . $theme
->getName() . ':prerender', $this
->getCacheTags());
}
public static function preRender(array $element) {
if (!empty($element['#bootstrap_ignore_pre_render'])) {
return $element;
}
$e = Element::create($element);
if ($e
->isType('machine_name')) {
$e
->addClass('form-inline', 'wrapper_attributes');
}
$e
->smartDescription();
return $element;
}
}
Classes
Name |
Description |
PrerenderManager |
Manages discovery and instantiation of Bootstrap pre-render callbacks. |