FullcalendarManager.php in FullCalendar 8
File
src/Plugin/FullcalendarManager.php
View source
<?php
namespace Drupal\fullcalendar\Plugin;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
class FullcalendarManager extends DefaultPluginManager {
protected $defaults = [
'css' => FALSE,
'js' => FALSE,
];
public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
parent::__construct('Plugin/fullcalendar/type', $namespaces, $module_handler, 'Drupal\\fullcalendar\\Plugin\\FullcalendarInterface', 'Drupal\\fullcalendar\\Annotation\\FullcalendarOption');
}
public function createInstance($plugin_id, array $configuration = [], $style = NULL) {
$plugin = parent::createInstance($plugin_id, $configuration);
if ($style) {
$plugin
->setStyle($style);
}
return $plugin;
}
}