function LayoutInfoController::layoutInfoPage
Same name in other branches
- 8.x-1.x src/Controller/LayoutInfoController.php \Drupal\devel\Controller\LayoutInfoController::layoutInfoPage()
- 4.x src/Controller/LayoutInfoController.php \Drupal\devel\Controller\LayoutInfoController::layoutInfoPage()
Builds the Layout Info page.
Return value
array Array of page elements to render.
1 string reference to 'LayoutInfoController::layoutInfoPage'
File
-
src/
Controller/ LayoutInfoController.php, line 36
Class
- LayoutInfoController
- Returns response for Layout Info route.
Namespace
Drupal\devel\ControllerCode
public function layoutInfoPage() : array {
$headers = [
$this->t('Icon'),
$this->t('Label'),
$this->t('Description'),
$this->t('Category'),
$this->t('Regions'),
$this->t('Provider'),
];
$rows = [];
foreach ($this->layoutPluginManager
->getDefinitions() as $layout) {
$rows[] = [
'icon' => [
'data' => $layout->getIcon(),
],
'label' => $layout->getLabel(),
'description' => $layout->getDescription(),
'category' => $layout->getCategory(),
'regions' => implode(', ', $layout->getRegionLabels()),
'provider' => $layout->getProvider(),
];
}
$output['layouts'] = [
'#type' => 'table',
'#header' => $headers,
'#rows' => $rows,
'#empty' => $this->t('No layouts available.'),
'#attributes' => [
'class' => [
'devel-layout-list',
],
],
];
return $output;
}