/**
* Returns a block theme demo page.
*
* @param string $theme
* The name of the theme.
*
* @return array
* A #type 'page' render array containing the block region demo.
*/
public function demo($theme) { if (!
$this->themeHandler->
hasUi($theme)) { throw new NotFoundHttpException();
} $page =
[ '#title' => Html::
escape($this->themeHandler->
getName($theme)),
'#type' => 'page',
'#attached' =>
[ 'drupalSettings' =>
[ // The block demonstration page is not marked as an administrative
// page by \Drupal::service('router.admin_context')->isAdminRoute()
// function in order to use the frontend theme. Since JavaScript