Examples
Same name in other branches
- 3.x examples.module \examples
- 7.x-1.x examples.module \examples
- 6.x-1.x examples.module \examples
- 4.0.x examples.module \examples
Well-documented API examples for a broad range of Drupal core functionality.
Developers can learn how to use a particular API quickly by experimenting with the examples, and adapt them for their own use.
Download the Examples for Developers Project (and participate with submissions, bug reports, patches, and documentation) at http://drupal.org/project/examples
File
-
./
examples.module, line 19
Functions
Title Sort descending | File name | Summary |
---|---|---|
examples_toolbar | ./ |
Implements hook_toolbar(). |
_examples_toolbar_routes | ./ |
Get a list of toolbar links to provide. |
Classes
Title Sort descending | File name | Summary |
---|---|---|
ExamplesTest | tests/ |
Minimal test case for the examples module. |
Sub-Topics
Title Sort descending | File name | Summary |
---|---|---|
Example: AJAX | ajax_example/ |
These examples show basic AJAX concepts. |
Example: Batch API | batch_example/ |
Outlines how a module can use the Batch API. |
Example: Block | block_example/ |
Demonstrates code creation of blocks. |
Example: Cache API | cache_example/ |
Demonstrates how a module can use the Cache API. |
Example: Config Entity | config_entity_example/ |
Implement a Config Entity. |
Example: Config Node Type | node_type_example/ |
A basic example of defining a content type through configuration YAML files. |
Example: Content Entity | content_entity_example/ |
Implement a content entity. |
Example: Cron | cron_example/ |
Example using Cron API, including hook_cron() and @QueueWorker plugins |
Example: Database (DBTNG) | dbtng_example/ |
Database examples, including DBTNG. |
Example: Draggable Table Forms | tabledrag_example/ |
|
Example: Events | events_example/ |
Demonstrates subscribing to, and dispatching, events. |
Example: Field Permissions | field_permission_example/ |
Example using permissions on a Field API field. |
Example: Field Types API | field_example/ |
Examples using Field Types API. |
Example: Forms API | form_api_example/ |
Examples using Forms API. |
Example: Hooks | hooks_example/ |
Demonstrates implementing, defining, and invoking hooks. |
Example: JavaScript | js_example/ |
Examples using Drupal 8's built-in JavaScript. |
Example: Page | page_example/ |
This example demonstrates how a module can display a page at a given URL. |
Example: Pager | pager_example/ |
Output nodes in the table with pagination. |
Example: PHPUnit | phpunit_example/ |
This example demonstrates PHPUnit for Drupal 8 unit testing. |
Example: Plugin Types | plugin_type_example/ |
Example of how to define a plugin type. |
Example: Queue | queue_example/ |
Demonstrating the Queue API |
Example: Render API | render_example/ |
The Render API consists of two parts: one, structured arrays that provide data, and hints about how that data should be rendered, and two, a rendering pipeline that can be used to render these arrays into various output formats. This example moduleā¦ |
Example: Session | session_example/ |
Demonstrating how to manipulate sessions in Drupal 8. |
Example: Stream Wrappers | stream_wrapper_example/ |
@group stream_wrapper_example |
Example: Tablesort | tablesort_example/ |
Example of a sortable table display. Three columns are sortable (Numbers, Letters and Mixture) We are using TableSort Extender extend('Drupal\Core\Database\Query\TableSortExtender') |
Example: Testing | testing_example/ |
This example demonstrates Drupal 8 testing frameworks. |
Example: Tour | tour_example/ |
The Tour module allows you you make instructional tours of user interfaces. |