function ElementInfoController::elementDetail
Same name in other branches
- 4.x src/Controller/ElementInfoController.php \Drupal\devel\Controller\ElementInfoController::elementDetail()
Returns a render array representation of the element.
Parameters
string $element_name: The name of the element to retrieve.
Return value
array A render array containing the element.
Throws
\Symfony\Component\HttpKernel\Exception\NotFoundHttpException If the requested element is not defined.
1 string reference to 'ElementInfoController::elementDetail'
File
-
src/
Controller/ ElementInfoController.php, line 121
Class
- ElementInfoController
- Provides route responses for the element info page.
Namespace
Drupal\devel\ControllerCode
public function elementDetail($element_name) : array {
if (!($element = $this->elementInfo
->getDefinition($element_name, FALSE))) {
throw new NotFoundHttpException();
}
$element += $this->elementInfo
->getInfo($element_name);
return $this->dumper
->exportAsRenderable($element, $element_name);
}