function BlockListController::listing
Same name and namespace in other branches
- 11.x core/modules/block/src/Controller/BlockListController.php \Drupal\block\Controller\BlockListController::listing()
- 10 core/modules/block/src/Controller/BlockListController.php \Drupal\block\Controller\BlockListController::listing()
- 9 core/modules/block/src/Controller/BlockListController.php \Drupal\block\Controller\BlockListController::listing()
- 8.9.x core/modules/block/src/Controller/BlockListController.php \Drupal\block\Controller\BlockListController::listing()
Shows the block administration page.
Attributes
#[Route(path: '/admin/structure/block', name: 'block.admin_display', requirements: [
'_permission' => 'administer blocks',
], defaults: [
'_title' => new TranslatableMarkup('Block layout'),
])]
#[Route(path: '/admin/structure/block/list/{theme}', name: 'block.admin_display_theme', requirements: [
'_access_theme' => 'TRUE',
'_permission' => 'administer blocks',
], defaults: [
'_title' => new TranslatableMarkup('Block layout'),
])]
Parameters
string|null $theme: Theme key of block list.
\Symfony\Component\HttpFoundation\Request $request: The current request.
Return value
array A render array as expected by \Drupal\Core\Render\RendererInterface::render().
Overrides EntityListController::listing
File
-
core/
modules/ block/ src/ Controller/ BlockListController.php, line 46
Class
- BlockListController
- Defines a controller to list blocks.
Namespace
Drupal\block\ControllerCode
public function listing($theme = NULL, ?Request $request = NULL) {
$theme = $theme ?: $this->config('system.theme')
->get('default');
if (!$this->themeHandler
->hasUi($theme)) {
throw new NotFoundHttpException();
}
return $this->entityTypeManager()
->getListBuilder('block')
->render($theme, $request);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.