function BlockListBuilder::buildForm
Same name in other branches
- 9 core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::buildForm()
- 8.9.x core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::buildForm()
- 11.x core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::buildForm()
Overrides FormInterface::buildForm
File
-
core/
modules/ block/ src/ BlockListBuilder.php, line 127
Class
- BlockListBuilder
- Defines a class to build a listing of block entities.
Namespace
Drupal\blockCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form['#attached']['library'][] = 'core/drupal.tableheader';
$form['#attached']['library'][] = 'block/drupal.block';
$form['#attached']['library'][] = 'block/drupal.block.admin';
$form['#attributes']['class'][] = 'clearfix';
// Build the form tree.
$form['blocks'] = $this->buildBlocksForm();
$form['actions'] = [
'#tree' => FALSE,
'#type' => 'actions',
];
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Save blocks'),
'#button_type' => 'primary',
];
return $form;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.