Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BlockAddController.php

function BlockAddController::blockAddConfigureForm

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.

1 string reference to 'BlockAddController::blockAddConfigureForm'
block.routing.yml in core/modules/block/block.routing.yml
core/modules/block/block.routing.yml

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 blockAddConfigureForm($plugin_id, $theme) {
    // Create a block entity.
    $entity = $this->entityTypeManager()
        ->getStorage('block')
        ->create([
        'plugin' => $plugin_id,
        'theme' => $theme,
    ]);
    return $this->entityFormBuilder()
        ->getForm($entity);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal