class SystemMainBlock in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/src/Plugin/Block/SystemMainBlock.php \Drupal\system\Plugin\Block\SystemMainBlock
- 9 core/modules/system/src/Plugin/Block/SystemMainBlock.php \Drupal\system\Plugin\Block\SystemMainBlock
Provides a 'Main page content' block.
Plugin annotation
@Block(
id = "system_main_block",
admin_label = @Translation("Main page content"),
forms = {
"settings_tray" = FALSE,
},
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\Core\Block\BlockBase implements BlockPluginInterface, ContextAwarePluginInterface, PluginWithFormsInterface, PreviewAwarePluginInterface, PreviewFallbackInterface uses BlockPluginTrait, ContextAwarePluginAssignmentTrait, ContextAwarePluginTrait
- class \Drupal\system\Plugin\Block\SystemMainBlock implements MainContentBlockPluginInterface
- class \Drupal\Core\Block\BlockBase implements BlockPluginInterface, ContextAwarePluginInterface, PluginWithFormsInterface, PreviewAwarePluginInterface, PreviewFallbackInterface uses BlockPluginTrait, ContextAwarePluginAssignmentTrait, ContextAwarePluginTrait
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of SystemMainBlock
File
- core/
modules/ system/ src/ Plugin/ Block/ SystemMainBlock.php, line 19
Namespace
Drupal\system\Plugin\BlockView source
class SystemMainBlock extends BlockBase implements MainContentBlockPluginInterface {
/**
* The render array representing the main page content.
*
* @var array
*/
protected $mainContent;
/**
* {@inheritdoc}
*/
public function setMainContent(array $main_content) {
$this->mainContent = $main_content;
}
/**
* {@inheritdoc}
*/
public function build() {
return $this->mainContent;
}
}