You are here

public function StateListBuilder::render in Country, State and City Fields 8

We override ::render() so that we can add our own content above the table. parent::render() is where EntityListBuilder creates the table using our buildHeader() and buildRow() implementations.

Overrides EntityListBuilder::render

File

src/Entity/Controller/StateListBuilder.php, line 58

Class

StateListBuilder
Provides a list controller for statelist entity.

Namespace

Drupal\country_state_city\Entity\Controller

Code

public function render() {
  $build['description'] = [
    '#markup' => $this
      ->t('State Entity implements a State model.'),
  ];
  $build['table'] = parent::render();
  \Drupal::service('cache.render')
    ->invalidateAll();
  return $build;
}