I am making a custom block in Drupal 8 and I want to show my entity list builder in it.Is there any example or certain way by which I can show my entity list in the block.


render() builds are renderable array for a table:

  public function build() {
    return \Drupal::entityTypeManager()->getListBuilder('entity_type')->render();

Reference: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityListBuilder.php/function/EntityListBuilder%3A%3Arender/8.5.x

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.