function ContainerInfoController::parameterDetail

Same name in other branches
  1. 4.x src/Controller/ContainerInfoController.php \Drupal\devel\Controller\ContainerInfoController::parameterDetail()

Returns a render array representation of the parameter value.

Parameters

string $parameter_name: The name of the parameter to retrieve.

Return value

array A render array containing the parameter value.

Throws

\Symfony\Component\HttpKernel\Exception\NotFoundHttpException If the requested parameter is not defined.

1 string reference to 'ContainerInfoController::parameterDetail'
devel.routing.yml in ./devel.routing.yml
devel.routing.yml

File

src/Controller/ContainerInfoController.php, line 228

Class

ContainerInfoController
Provides route responses for the container info pages.

Namespace

Drupal\devel\Controller

Code

public function parameterDetail(string $parameter_name) : array {
    $container = $this->kernel
        ->getContainer();
    try {
        $parameter = $container->getParameter($parameter_name);
    } catch (ParameterNotFoundException) {
        throw new NotFoundHttpException();
    }
    return $this->dumper
        ->exportAsRenderable($parameter);
}