public function ElementInfoController::elementDetail in Devel 8
Same name and namespace in other branches
- 8.3 src/Controller/ElementInfoController.php \Drupal\devel\Controller\ElementInfoController::elementDetail()
- 8.2 src/Controller/ElementInfoController.php \Drupal\devel\Controller\ElementInfoController::elementDetail()
- 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 153
Class
- ElementInfoController
- Provides route responses for the element info page.
Namespace
Drupal\devel\ControllerCode
public function elementDetail($element_name) {
if (!($element = $this->elementInfo
->getDefinition($element_name, FALSE))) {
throw new NotFoundHttpException();
}
$element += $this->elementInfo
->getInfo($element_name);
return $this->dumper
->exportAsRenderable($element, $element_name);
}