You are here

public function TagListBuilder::buildRow in Extensible BBCode 8.3

Same name and namespace in other branches
  1. 4.0.x src/TagListBuilder.php \Drupal\xbbcode\TagListBuilder::buildRow()

Builds a row for an entity in the entity listing.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for this row of the list.

Return value

array A render array structure of fields for this entity.

Overrides EntityListBuilder::buildRow

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

src/TagListBuilder.php, line 26

Class

TagListBuilder
Build a table view of custom tags.

Namespace

Drupal\xbbcode

Code

public function buildRow(EntityInterface $entity) : array {

  /** @var \Drupal\xbbcode\Entity\TagInterface $entity */
  $row['tag'] = $entity
    ->label();
  $row['description'] = $entity
    ->getDescription();
  $row['sample'] = [
    'data' => str_replace('{{ name }}', $entity
      ->getName(), $entity
      ->getSample()),
    'style' => 'font-family:monospace',
  ];
  return $row + parent::buildRow($entity);
}