- Drupal 8 Module Development
- Daniel Sipos
- 244字
- 2021-07-02 15:45:10
Fields
Now that we have an idea of what entities are, let's take a look at how data is actually stored on these entities.
I have alluded in the preceding section to how certain entity bundles can have various fields. This means that each entity type bundle can have any number of fields that are responsible for holding data. Additionally, each entity type itself can have fields for storing data. Okay, but what? Let's break this down.
There are two types of Fields in Drupal 8--base fields and configurable fields. The former are fields that are defined in the code for each entity type you define (or alter), whereas the latter are usually created and configured in the UI and attached to a bundle of that entity type and exported via configuration. So, essentially, both types can end up in the code to be deployed.
Fields can also be of multiples types, depending on the data they store. For example, you can have string (or text) fields, numeric fields, date fields, email fields, and so on. As developers, we can create our own field types if the existing ones are not good enough for our data.
In this book, we will take a look at how we can define base fields on a certain entity type and create our own field type with its own data input widget and output formatter. Site builders can then use this field type on any entity type.
- 微服務(wù)設(shè)計(jì)(第2版)
- R語言游戲數(shù)據(jù)分析與挖掘
- OpenCV 3和Qt5計(jì)算機(jī)視覺應(yīng)用開發(fā)
- ArcGIS By Example
- Windows Phone 7.5:Building Location-aware Applications
- C語言從入門到精通
- Java Web從入門到精通(第3版)
- Django 3.0應(yīng)用開發(fā)詳解
- Cinder:Begin Creative Coding
- Implementing Splunk(Second Edition)
- TypeScript High Performance
- C#程序設(shè)計(jì)基礎(chǔ)與實(shí)踐
- 編譯原理學(xué)習(xí)與實(shí)踐指導(dǎo)
- 算法(第4版)
- Python語言及其應(yīng)用(第2版)