public function ExternalLinkPopupListBuilder::buildRow in External Link Pop-up 8
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 DraggableListBuilder::buildRow
See also
\Drupal\Core\Entity\EntityListBuilder::render()
File
- src/
Controller/ ExternalLinkPopupListBuilder.php, line 28
Class
- ExternalLinkPopupListBuilder
- Provides a listing of Example.
Namespace
Drupal\external_link_popup\ControllerCode
public function buildRow(EntityInterface $entity) {
$row['label'] = $entity
->label();
$row['id']['#markup'] = $entity
->id();
$row['domains']['#markup'] = $entity
->getDomains() ? preg_replace("/\\s*\n\\s*/", ', ', $entity
->getDomains()) : '';
if ($entity
->status()) {
$row['status']['#markup'] = $this
->t('Enabled');
}
else {
$row['status']['#markup'] = $this
->t('Disabled');
}
return $row + parent::buildRow($entity);
}