You are here

public function TaxRateListBuilder::render in Ubercart 8.4

Same name in this branch
  1. 8.4 uc_tax/src/TaxRateListBuilder.php \Drupal\uc_tax\TaxRateListBuilder::render()
  2. 8.4 uc_tax/src/Controller/TaxRateListBuilder.php \Drupal\uc_tax\Controller\TaxRateListBuilder::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

uc_tax/src/Controller/TaxRateListBuilder.php, line 67

Class

TaxRateListBuilder
Provides a listing of uc_tax_rate configuration entities.

Namespace

Drupal\uc_tax\Controller

Code

public function render() {
  $build['description'] = [
    '#markup' => $this
      ->t("<p>This is a list of the tax rates currently defined on your Drupal site.</p><p>You may use the 'Add a tax rate' button to add a new rate, or use the widget in the 'Operations' column to edit, delete, or clone existing tax rates.</p>"),
  ];
  $build += parent::render();
  $build['table']['#empty'] = $this
    ->t('No tax rates have been configured yet.');
  $build['table']['#tabledrag'] = [
    [
      'action' => 'order',
      'relationship' => 'sibling',
      'group' => 'uc-tax-method-weight',
    ],
  ];
  return $build;
}