function entity_render_controller

Returns an entity render controller for a given entity type.

Parameters

string $entity_type: The type of the entity.

Return value

Drupal\Core\Entity\EntityRenderControllerInterface An entity render controller.

See also

\Drupal\Core\Entity\EntityManager

File

drupal/core/includes/entity.inc, line 523
Entity API for handling entities like nodes or users.

Code

function entity_render_controller($entity_type) {
  $info = entity_get_info($entity_type);
  $class = $info['render_controller_class'];
  return new $class($entity_type);
}