Same name in this branch
- 8.x-3.x src/Plugin/Derivative/QuickTabsBlock.php \Drupal\quicktabs\Plugin\Derivative\QuickTabsBlock
Same name in other branches
- 4.x src/Plugin/Block/QuickTabsBlock.php \Drupal\quicktabs\Plugin\Block\QuickTabsBlock
- 4.x src/Plugin/Derivative/QuickTabsBlock.php \Drupal\quicktabs\Plugin\Derivative\QuickTabsBlock
Provides a 'QuickTabs' block.
Plugin annotation
@Block(
id = "quicktabs_block",
admin_label = @Translation("QuickTabs Block"),
category = @Translation("QuickTabs"),
deriver = "Drupal\quicktabs\Plugin\Derivative\QuickTabsBlock"
)
Hierarchy
- class \Drupal\quicktabs\Plugin\Block\QuickTabsBlock extends \Drupal\Core\Block\BlockBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface
Expanded class hierarchy of QuickTabsBlock
File
-
src/
Plugin/ Block/ QuickTabsBlock.php, line 20
Namespace
Drupal\quicktabs\Plugin\BlockView source
class QuickTabsBlock extends BlockBase implements ContainerFactoryPluginInterface {
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* Constructs a BlockComponentRenderArray object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin ID for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
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;
}
/**
* {@inheritdoc}
*/
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'));
}
/**
* {@inheritdoc}
*/
public function build() {
$qt_id = $this->getDerivativeId();
$qt = $this->entityTypeManager
->getStorage('quicktabs_instance')
->load($qt_id);
return $qt->getRenderArray();
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
QuickTabsBlock::$entityTypeManager | protected | property | The entity type manager. |
QuickTabsBlock::build | public | function | |
QuickTabsBlock::create | public static | function | |
QuickTabsBlock::__construct | public | function | Constructs a BlockComponentRenderArray object. |