function EntityTypeInfoController::entityTypeDetail

Same name in other branches
  1. 5.x src/Controller/EntityTypeInfoController.php \Drupal\devel\Controller\EntityTypeInfoController::entityTypeDetail()

Returns a render array representation of the entity type.

Parameters

string $entity_type_id: The name of the entity type to retrieve.

Return value

array A render array containing the entity type.

Throws

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

1 string reference to 'EntityTypeInfoController::entityTypeDetail'
devel.routing.yml in ./devel.routing.yml
devel.routing.yml

File

src/Controller/EntityTypeInfoController.php, line 153

Class

EntityTypeInfoController
Provides route responses for the entity types info page.

Namespace

Drupal\devel\Controller

Code

public function entityTypeDetail($entity_type_id) {
    if (!($entity_type = $this->entityTypeManager()
        ->getDefinition($entity_type_id, FALSE))) {
        throw new NotFoundHttpException();
    }
    return $this->dumper
        ->exportAsRenderable($entity_type, $entity_type_id);
}