3 namespace Drupal\block\Controller;
5 use Drupal\Core\Controller\ControllerBase;
8 * Controller for building the block instance add form.
10 class BlockAddController extends ControllerBase {
13 * Build the block instance add form.
15 * @param string $plugin_id
16 * The plugin ID for the block instance.
17 * @param string $theme
18 * The name of the theme for the block instance.
21 * The block instance edit form.
23 public function blockAddConfigureForm($plugin_id, $theme) {
24 // Create a block entity.
25 $entity = $this->entityManager()->getStorage('block')->create(['plugin' => $plugin_id, 'theme' => $theme]);
27 return $this->entityFormBuilder()->getForm($entity);