QuickTabsBlock.php in Quick Tabs 8.3
File
src/Plugin/Block/QuickTabsBlock.php
View source
<?php
namespace Drupal\quicktabs\Plugin\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
class QuickTabsBlock extends BlockBase implements ContainerFactoryPluginInterface {
protected $entityTypeManager;
public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->entityTypeManager = $entity_type_manager;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('entity_type.manager'));
}
public function build() {
$qt_id = $this
->getDerivativeId();
$qt = $this->entityTypeManager
->getStorage('quicktabs_instance')
->load($qt_id);
return $qt
->getRenderArray();
}
}