EntityListController.php

Same filename in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/Controller/EntityListController.php
  2. 10 core/lib/Drupal/Core/Entity/Controller/EntityListController.php
  3. 11.x core/lib/Drupal/Core/Entity/Controller/EntityListController.php

Namespace

Drupal\Core\Entity\Controller

File

core/lib/Drupal/Core/Entity/Controller/EntityListController.php

View source
<?php

namespace Drupal\Core\Entity\Controller;

use Drupal\Core\Controller\ControllerBase;

/**
 * Defines a generic controller to list entities.
 */
class EntityListController extends ControllerBase {
    
    /**
     * Provides the listing page for any entity type.
     *
     * @param string $entity_type
     *   The entity type to render.
     *
     * @return array
     *   A render array as expected by
     *   \Drupal\Core\Render\RendererInterface::render().
     */
    public function listing($entity_type) {
        return $this->entityTypeManager()
            ->getListBuilder($entity_type)
            ->render();
    }

}

Classes

Title Deprecated Summary
EntityListController Defines a generic controller to list entities.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.