BlockBase::calculateDependencies

public BlockBase::calculateDependencies() Calculates dependencies for the configured plugin. Dependencies are saved in the plugin's configuration entity and are used to determine configuration synchronization order. For example, if the plugin integrates with specific user roles, this method should return an array of dependencies listing the specified roles. Return value array An array of dependencies grouped by type (config, content, module, theme). For example: array( 'config' => arr

BlockBase::buildConfigurationForm

public BlockBase::buildConfigurationForm(array $form, FormStateInterface $form_state) Creates a generic configuration form for all block types. Individual block plugins can add elements to this form by overriding BlockBase::blockForm(). Most block plugins should not override this method unless they need to alter the generic form elements. Overrides PluginFormInterface::buildConfigurationForm See also \Drupal\Core\Block\BlockBase::blockForm() File core/lib/Drupal/Core/Block/BlockBase.php, line

BlockBase::blockValidate

public BlockBase::blockValidate($form, FormStateInterface $form_state) Adds block type-specific validation for the block form. Note that this method takes the form structure and form state for the full block configuration form as arguments, not just the elements defined in BlockPluginInterface::blockForm(). Parameters array $form: The form definition array for the full block configuration form. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Overrides BlockPlug

BlockBase::blockSubmit

public BlockBase::blockSubmit($form, FormStateInterface $form_state) Adds block type-specific submission handling for the block form. Note that this method takes the form structure and form state for the full block configuration form as arguments, not just the elements defined in BlockPluginInterface::blockForm(). Parameters array $form: The form definition array for the full block configuration form. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Overrides Bl

BlockBase::blockForm

public BlockBase::blockForm($form, FormStateInterface $form_state) Returns the configuration form elements specific to this block plugin. Blocks that need to add form elements to the normal block configuration form should implement this method. Parameters array $form: The form definition array for the block configuration form. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Return value array $form The renderable form array representing the entire configuratio

BlockBase::blockAccess

protected BlockBase::blockAccess(AccountInterface $account) Indicates whether the block should be shown. Blocks with specific access checking should override this method rather than access(), in order to avoid repeating the handling of the $return_as_object argument. Parameters \Drupal\Core\Session\AccountInterface $account: The user session for which to check access. Return value \Drupal\Core\Access\AccessResult The access result. See also self::access() File core/lib/Drupal/Core/Block/Bloc

BlockBase::baseConfigurationDefaults

protected BlockBase::baseConfigurationDefaults() Returns generic default configuration for block plugins. Return value array An associative array with the default configuration. File core/lib/Drupal/Core/Block/BlockBase.php, line 85 Class BlockBase Defines a base block implementation that most blocks plugins will extend. Namespace Drupal\Core\Block Code protected function baseConfigurationDefaults() { return array( 'id' => $this->getPluginId(), 'label' => '', 'p

BlockBase::access

public BlockBase::access(AccountInterface $account, $return_as_object = FALSE) Indicates whether the block should be shown. This method allows base implementations to add general access restrictions that should apply to all extending block plugins. Parameters \Drupal\Core\Session\AccountInterface $account: The user session for which to check access. bool $return_as_object: (optional) Defaults to FALSE. Return value bool|\Drupal\Core\Access\AccessResultInterface The access result. Returns a bo

BlockBase::$transliteration

The transliteration service. Type: \Drupal\Component\Transliteration\TransliterationInterface File core/lib/Drupal/Core/Block/BlockBase.php, line 37 Class BlockBase Defines a base block implementation that most blocks plugins will extend. Namespace Drupal\Core\Block Code protected $transliteration;

BlockBase

Defines a base block implementation that most blocks plugins will extend. This abstract class provides the generic block configuration form, default block settings, and handling for general user-defined block visibility settings. Hierarchy class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterfaceclass \Drupal\Component\Plugin\ContextAwarePluginBase implements ContextAwarePluginInterfaceclass \Drupal\Core\Plugin\ContextAwarePluginBase implement