Views fields

But in order to actually use this table, we need to define one or more fields that can output some of its data. So, we start with a simple one, the player IDs. Anything that comes under the $data['table_name'] array (that is not keyed by table, as we've seen) is responsible for defining Views fields. The keys are their machine names. title and help are there again and are used in the UI when we try to add the respective fields:

The most important part of this definition, however, is the field key which basically says for this piece of data, we want a Views field that uses the ViewsField plugin with the ID numeric (NumericField ...

Get Drupal 8 Module Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.