function ContainerInfoController::parameterList
Same name in other branches
- 4.x src/Controller/ContainerInfoController.php \Drupal\devel\Controller\ContainerInfoController::parameterList()
Builds the parameters overview page.
Return value
array A render array as expected by the renderer.
1 string reference to 'ContainerInfoController::parameterList'
File
-
src/
Controller/ ContainerInfoController.php, line 161
Class
- ContainerInfoController
- Provides route responses for the container info pages.
Namespace
Drupal\devel\ControllerCode
public function parameterList() : array {
$headers = [
$this->t('Name'),
$this->t('Operations'),
];
$rows = [];
if ($cached_definitions = $this->kernel
->getCachedContainerDefinition()) {
foreach ($cached_definitions['parameters'] as $parameter_name => $definition) {
$row['name'] = [
'data' => $parameter_name,
'filter' => TRUE,
];
$row['operations']['data'] = [
'#type' => 'operations',
'#links' => [
'devel' => [
'title' => $this->t('Devel'),
'url' => Url::fromRoute('devel.container_info.parameter.detail', [
'parameter_name' => $parameter_name,
]),
'attributes' => [
'class' => [
'use-ajax',
],
'data-dialog-type' => 'modal',
'data-dialog-options' => Json::encode([
'width' => 700,
'minHeight' => 500,
]),
],
],
],
];
$rows[$parameter_name] = $row;
}
ksort($rows);
}
$output['parameters'] = [
'#type' => 'devel_table_filter',
'#filter_label' => $this->t('Search'),
'#filter_placeholder' => $this->t('Enter parameter name'),
'#filter_description' => $this->t('Enter a part of the parameter name to filter by.'),
'#header' => $headers,
'#rows' => $rows,
'#empty' => $this->t('No parameters found.'),
'#sticky' => TRUE,
'#attributes' => [
'class' => [
'devel-parameter-list',
],
],
];
return $output;
}