BlockBase::getMachineNameSuggestion

public BlockBase::getMachineNameSuggestion() Suggests a machine name to identify an instance of this block. The block plugin need not verify that the machine name is at all unique. It is only responsible for providing a baseline suggestion; calling code is responsible for ensuring whatever uniqueness is required for the use case. Return value string The suggested machine name. Overrides BlockPluginInterface::getMachineNameSuggestion File core/lib/Drupal/Core/Block/BlockBase.php, line 240 Cl

BlockBase::setConfiguration

public BlockBase::setConfiguration(array $configuration) Sets the configuration for this plugin instance. Parameters array $configuration: An associative array containing the plugin's configuration. Overrides ConfigurablePluginInterface::setConfiguration File core/lib/Drupal/Core/Block/BlockBase.php, line 71 Class BlockBase Defines a base block implementation that most blocks plugins will extend. Namespace Drupal\Core\Block Code public function setConfiguration(array $configuration) {

BlockBase::label

public BlockBase::label() Returns the user-facing block label. @todo Provide other specific label-related methods in https://www.drupal.org/node/2025649. Return value string The block label. Overrides BlockPluginInterface::label File core/lib/Drupal/Core/Block/BlockBase.php, line 42 Class BlockBase Defines a base block implementation that most blocks plugins will extend. Namespace Drupal\Core\Block Code public function label() { if (!empty($this->configuration['label'])) { re

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::$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::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::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::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::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

BlockAddController::blockAddConfigureForm

public BlockAddController::blockAddConfigureForm($plugin_id, $theme) Build the block instance add form. Parameters string $plugin_id: The plugin ID for the block instance. string $theme: The name of the theme for the block instance. Return value array The block instance edit form. File core/modules/block/src/Controller/BlockAddController.php, line 23 Class BlockAddController Controller for building the block instance add form. Namespace Drupal\block\Controller Code public function bl