function UserListBuilder::buildHeader
Builds the header row for the entity listing.
Return value
array A render array structure of header strings.
Overrides EntityListBuilder::buildHeader
1 call to UserListBuilder::buildHeader()
- UserListBuilder::load in core/
modules/ user/ src/ UserListBuilder.php  - Loads entities of this type from storage for listing.
 
File
- 
              core/
modules/ user/ src/ UserListBuilder.php, line 83  
Class
- UserListBuilder
 - Defines a class to build a listing of user entities.
 
Namespace
Drupal\userCode
public function buildHeader() {
  $header = [
    'username' => [
      'data' => $this->t('Username'),
      'field' => 'name',
      'specifier' => 'name',
    ],
    'status' => [
      'data' => $this->t('Status'),
      'field' => 'status',
      'specifier' => 'status',
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
    'roles' => [
      'data' => $this->t('Roles'),
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
    'member_for' => [
      'data' => $this->t('Member for'),
      'field' => 'created',
      'specifier' => 'created',
      'sort' => 'desc',
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
    'access' => [
      'data' => $this->t('Last access'),
      'field' => 'access',
      'specifier' => 'access',
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
  ];
  return $header + parent::buildHeader();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.