themeHandler = $theme_handler; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( $container->get('theme_handler') ); } /** * Shows the block administration page. * * @param string|null $theme * Theme key of block list. * @param \Symfony\Component\HttpFoundation\Request $request * The current request. * * @return array * A render array as expected by * \Drupal\Core\Render\RendererInterface::render(). */ 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->entityManager()->getListBuilder('block')->render($theme, $request); } }