Drupal 8 introduces many new APIs and keeps only some of the Drupal 7/6 API. This section details the APIs in Drupal 8.
Before diving into the documentation below you might want to read the background and prerequisites, and the Creating Drupal 8.x modules guides, both of which explain some concepts and terminology that will be assumed knowledge in the API documentation here.
For a crash course, but with some real depth, check out Understanding Drupal 8. It provides an overview of many of the key D8 APIs.
Finally, review the Drupal 8 backwards compatibility policy for an explanation of what may change between minor versions of Drupal 8 and what will remain stable.
Documentation for Authentication API in Drupal 8.
Documentation for Block API in Drupal 8.
Documentation for Cache API in Drupal 8.
- Cache API
- Cache tags
- Cache contexts
- Cache max-age
- Cache tags + Varnish
- CacheableDependencyInterface & friends
- Access checkers + cacheability
Documentation for CKEditor API in Drupal 8.
Configuration API in Drupal 8.
- Configuration API overview
- Overview of Configuration (vs. other types of information)
- Configuration Storage in Drupal 8
- Configuration override system
- Configuration schema/metadata
- Configuration entity dependencies
- Creating a configuration entity type in Drupal 8
- Simple Configuration API
- Working with Configuration Forms
Documentation for the Database API in Drupal 8.
- Database API Overview
- General concepts
- Database Configuration
- Instantiating a Connection Object
- Static Queries
- Dynamic Queries
- Result Sets
- Fetching Into a Custom Class
- Insert Queries
- Update Queries
- Merge Queries
- Delete Queries
- Error Handling
- Functions and Operators
Drupal 8 Entity API documentation.
- Introduction to Entity API in Drupal 8
- Entity types
- Working with the Entity API
- Configuration Entity
- Content Entity
- Create a custom content entity.
- Creating a custom content type in Drupal 8
- Programming custom fields into your content type
- Using the UI to export the code for your custom fields
- Entity API implements Typed Data API
- Access on entities (TBD)
- Defining and using Content Entity Field definitions
- Entity Translation API
- Display Modes, View Modes, and Form Modes
- FieldTypes, FieldWidgets and FieldFormatters
- Upgrading Code Snippets Module to Drupal 8: Creating a Custom Field
- Dynamic/Virtual field values using computed field property classes
- Making an entity revisionable
- Structure of an Entity annotation
- Creating a content entity type in Drupal 8
- Making the content entity searchable
- Converting a content entity type to be revisionable and publishable
Entity validation API in Drupal 8.
- Entity Validation API overview
- Providing a custom validation constraint [TBD]
- Supported validation constraints [TBD]
Documentation for Filter API in Drupal 8.
Form API in Drupal 8.
- Introduction to Form API
- ConfigFormBase with Simple Configuration API
- ConfirmFormBase To Confirm an Action
- Form Render Elements
- Add Javascipt to Your Theme or Module
- Ajax Forms
Documentation for Layout API in Drupal 8.
Documentation for Logging API in Drupal 8.
Menu API in Drupal 8.
- Comparison of Menu API in Drupal 7 and 8
- Providing module-defined menu links
- Providing module-defined local tasks
- Providing module-defined actions
- Providing module-defined contextual links
- User stories for Drupal’s menu API
Documentation for Middleware API in Drupal 8.
The Migrate API provides services for migrating data from different sources to Drupal 8.
- Migrate API overview
- Migrate source plugins
- Migrate process plugins
- Migrate destination plugins & examples
- Executing migrations
- Writing migrations for contributed and custom modules
- Migration Tests in Drupal 8
- Generating database fixtures for D8 Migrate tests
- Debugging migrations
The Plugins API is used to extend Drupal and add new functionality, and allow modules to define new plugin types.
- Plugin API overview
- Why Plugins?
- Annotations-based plugins
- Annotation-Based Plugins in Views
- Creating your own Plugin Manager
- D8 Plugin discovery
- Discovery Decorators
- Plugin Definitions
- Plugin Contexts
- Plugin Derivatives
- Create your own custom annotation class
- Creating a plugin that can be defined in themes
Documentation for Quick Edit API in Drupal 8.
RESTful Web Services API in Drupal 8.
Render API in Drupal 8.
- Cacheability of render arrays
- Bubbleable metadata
- Render arrays
- The Drupal 8 render pipeline
Responses in Drupal 8
Routing system in Drupal 8.
- Routing system overview
- Introductory Drupal 8 routes and controllers example
- Structure of routes
- Altering existing routes and adding new routes based on dynamic ones
- Providing dynamic routes
- Routing-related objects: Route, CurrentRouteMatch, RouteMatch, Url
- Underlying functionality of the routing system in Drupal 8
- Access checking on routes
- Parameters in routes
A runtime assertion is a statement that is expected to always be true at the point in the code it appears at.
Serialization API in Drupal 8.
- Serialization API overview
- How the Serializer works
- Adding new formats
- Changing the way Serializer handles entities
Services and dependency injection in Drupal 8.
- Services and dependency injection in Drupal 8
- Altering existing services, providing dynamic services
- Dependency Injection for a Form
- Service Tags
- Structure of a service file
Documentation for State API in Drupal 8.
Documentation for Text Editor API in Drupal 8.
Documentation for Tour API in Drupal 8.
Documentation for Translation API (Code text) in Drupal 8.
Typed Data API in Drupal 8.
Update API for Drupal 8 (hook_update_N() etc.)
- Introduction to update API for Drupal 8
- Updating Configuration in Drupal 8
- Updating Database Schema and/or Data in Drupal 8
- Updating Entities and Fields in Drupal 8
- Writing Automated Update Tests for Drupal 8