
| Current Path : /var/www/html/rocksensor1/web/core/modules/block/src/Controller/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor1/web/core/modules/block/src/Controller/BlockAddController.php |
<?php
namespace Drupal\block\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* Controller for building the block instance add form.
*/
class BlockAddController extends ControllerBase {
/**
* Build the block instance add form.
*
* @param string $plugin_id
* The plugin ID for the block instance.
* @param string $theme
* The name of the theme for the block instance.
*
* @return array
* The block instance edit form.
*/
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);
}
}