Module that contains examples of commonly used functionality

4 years after

Drupal 8 examples

Module that contains examples of commonly used functionality. For every item, the files to look at are listed.

An overview of examples:


Normal menu callback

  • d8_examples.routing.yml
  • src/Controller/ExampleController.php

Building / validating / submitting / redirecting a form

  • d8_examples.routing.yml
  • src/Controller/ExampleController.php
  • src/Form/ExampleForm.php

A system settings form

  • d8_examples.routing.yml
  • d8_examples.links.menu.yml
  • src/Form/SettingsForm.php


Views default argument

  • src/Plugin/views/argument_default/DemoDefaultArgument.php

Views filter

  • d8_examples.views.inc
  • src/Plugin/views/filter/UpdatedThisMonth.php

CK Editor Plugin

  • src/Plugin/CKEditorPlugin/CodeSnippet.php

Display Suite Field

  • src/Plugin/DsField/DemoField.php