In this tutorial, we'll create a new module and create a route and controller for it. Remember hook_menu
? Well, hook_menu
is out and routes and controllers are in! If the YAML files in this lesson piqued your interest, check out our introduction to YAML tutorial to learn more.
Note: There is a new core_version_requirement
property for info files, starting with Drupal 8.8.x, including Drupal 9.x. For Drupal sites using version 8.8 and above, instead of the core
property, use core_version_requirement
. In most cases, adding core_version_requirement: ^8 || ^9
to your info file and removing core: 8.x
will be sufficient. See Create an Info File for a Module for details.
For Drupal 8.8 and above and Drupal 9 PROJECT/web/modules/dino_roar/dino_roar.info.yml:
name: Dino ROAR type: module description: "ROAR at you" package: Sample core_version_requirement: ^8 || ^9