Same name and namespace in other branches
  1. 8.x-1.x field_example/field_example.module \field_example

Examples using Field Types API.

Providing a field requires:

Our module defines the field in field_example_field_info(), field_example_field_validate() and field_example_field_is_empty(). field_example_field_schema() is implemented in field_example.install.

Our module sets up a formatter in field_example_field_formatter_info() and field_example_field_formatter_view(). These are the API hooks that present formatted and themed output to the user.

And finally, our module defines the widget in field_example_field_widget_info() and field_example_field_widget_form(). The widget is the form element used to receive input from the user when the field is being populated.

See also

Field Types API

Field API

Parent topics

File

field_example/field_example.module, line 7
An example field using the Field Types API.

Functions

Classes

Namesort descending Location Description
FieldExampleTest field_example/field_example.test Functional tests for the Field Example module.