You are here

public function PathAliasListBuilder::render in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/path/src/PathAliasListBuilder.php \Drupal\path\PathAliasListBuilder::render()
  2. 9 core/modules/path/src/PathAliasListBuilder.php \Drupal\path\PathAliasListBuilder::render()

Builds the entity listing as renderable array for table.html.twig.

@todo Add a link to add a new item to the #empty text.

Overrides EntityListBuilder::render

File

core/modules/path/src/PathAliasListBuilder.php, line 118

Class

PathAliasListBuilder
Defines a class to build a listing of path_alias entities.

Namespace

Drupal\path

Code

public function render() {
  $keys = $this->currentRequest->query
    ->get('search');
  $build['path_admin_filter_form'] = $this->formBuilder
    ->getForm(PathFilterForm::class, $keys);
  $build += parent::render();
  $build['table']['#empty'] = $this
    ->t('No path aliases available. <a href=":link">Add URL alias</a>.', [
    ':link' => Url::fromRoute('entity.path_alias.add_form')
      ->toString(),
  ]);
  return $build;
}